public void Initialize()
 {
     controller = ControllerHelper.GetInitializedPeopleController(_mockPersonManager.Object);
 }
 public PeopleControllerTests()
 {
     MockPersonRepository = new Mock <IPersonRepository>();
     PeopleController     = new PeopleController(MockPersonRepository.Object);
 }
示例#3
0
 public LibraryController(PeopleController peopleController)
 {
     PeopleController = peopleController;
     Library          = new Library(this);
 }
示例#4
0
 public void init()
 {
     sut = new PeopleController();
 }
 void Awake()
 {
     //Create Singleton
     peopleController = this;
 }
 public UnitTest1()
 {
     _peopleRepository = new PeopleRepositoryFake();
     _controller       = new PeopleController(_peopleRepository);
 }
 public void Initialize()
 {
     controller = new PeopleController();
 }
示例#8
0
 public PeopleControllerTest()
 {
     _peopleService = new MockPeopleService();
     _controller    = new PeopleController(_peopleService);
 }
示例#9
0
 public PeopleControllerTests()
 {
     _mockPeopleBuilder = new Mock <IModelBuilder <string, Data.Models.People> >();
     _peopleController  = new PeopleController(_mockPeopleBuilder.Object);
 }
 public void Init()
 {
     Controller = new PeopleController();
 }
示例#11
0
        public void TestGetPeople()
        {
            PeopleController controller = new PeopleController();

            Assert.IsNotNull(controller.GetPerson(1));
        }
示例#12
0
 public PeopleControllerTests()
 {
     controller = new PeopleController(moq.Object, moqPhone.Object, moqEmail.Object);
 }
        public async Task Test_GetPeople_Data_ExpectSuccess()
        {
            //arrange
            var expectedData = new List <GenderViewDto>
            {
                new GenderViewDto
                {
                    Gender = GenderTypeEnum.Female,
                    Cats   = new List <CatViewDto>
                    {
                        new CatViewDto
                        {
                            Name = "Waffles"
                        }
                    },
                },
                new GenderViewDto
                {
                    Gender = GenderTypeEnum.Male,
                    Cats   = new List <CatViewDto>
                    {
                        new CatViewDto
                        {
                            Name = "Albert",
                        },
                        new CatViewDto
                        {
                            Name = "Helen",
                        }
                    },
                },
            };

            _mockPeopleBusinessLogic.Setup(p => p.GetPeople())
            .Returns(Task.Run(() => new Response <List <GenderViewDto> > {
                Data = expectedData
            }));

            _sut = new PeopleController(_mockPeopleBusinessLogic.Object);

            //act
            var actionResult = await _sut.Index();

            //assert
            Assert.NotNull(actionResult);
            Assert.True(actionResult is ViewResult);

            var viewResult = actionResult as ViewResult;

            Assert.NotNull(viewResult);
            Assert.NotNull(viewResult.Model);
            Assert.True(viewResult.Model is List <Gender>);

            var genders = viewResult.Model as List <Gender>;

            Assert.NotNull(genders);
            Assert.True(genders.Count == 2);

            var maleOwners = genders.FirstOrDefault(p => p.GenderType == GenderTypeEnum.Male);

            Assert.NotNull(maleOwners);
            Assert.NotNull(maleOwners.Cats);
            Assert.True(maleOwners.Cats.Count == 2);
            Assert.True(maleOwners.Cats.FirstOrDefault()?.Name == "Albert");
            Assert.True(maleOwners.Cats[1]?.Name == "Helen");

            var femaleOwners = genders.FirstOrDefault(p => p.GenderType == GenderTypeEnum.Female);

            Assert.NotNull(femaleOwners);
            Assert.NotNull(femaleOwners.Cats);
            Assert.True(femaleOwners.Cats.Count == 1);
            Assert.True(femaleOwners.Cats.FirstOrDefault()?.Name == "Waffles");
        }
示例#14
0
 public PeopleControllerTests()
 {
     _controller = new PeopleController(_mockBenefitsService.Object, _mockCouncilTaxService.Object);
 }
示例#15
0
 public PeopleControllerTest()
 {
     _peopleController = new PeopleController(_repo, _userManager);
 }
示例#16
0
 public void Initialize()
 {
     _repositoryMock = new Mock <IPeopleRepository>();
     _controller     = new PeopleController(_repositoryMock.Object);
 }