BinaryStudio.ClientManager.WebUi.Tests.Controllers.InquiryControllerTests.ShouldNot_ReturnCategoriesWithEmptyInquiries_WhenAllRequested C# (CSharp) Метод

ShouldNot_ReturnCategoriesWithEmptyInquiries_WhenAllRequested() приватный Метод

private ShouldNot_ReturnCategoriesWithEmptyInquiries_WhenAllRequested ( ) : void
Результат void
        public void ShouldNot_ReturnCategoriesWithEmptyInquiries_WhenAllRequested()
        {
            // arrange
            var mock = new Mock<IRepository>();
            mock.Setup(z => z.Query<Inquiry>(x => x.Client, x => x.Tags)).Returns(new List<Inquiry>().AsQueryable());
            mock.Setup(z => z.Query<Tag>(x => x.Inquiries)).Returns(new List<Tag>
            {
                new Tag
                {
                    Inquiries = new List<Inquiry>(),
                    Name = "",
                    Id = 1
                }
            }.AsQueryable());
            var inquiriesController = new InquiriesController(mock.Object).MockHttpContext();

            //act
            var viewResult = (AllInquiriesViewModel) inquiriesController.All().Model;

            //assert
            viewResult.Categories.Count().Should().Be(0);
        }