public void Initialize() { controller = ControllerHelper.GetInitializedPeopleController(_mockPersonManager.Object); }
public PeopleControllerTests() { MockPersonRepository = new Mock <IPersonRepository>(); PeopleController = new PeopleController(MockPersonRepository.Object); }
public LibraryController(PeopleController peopleController) { PeopleController = peopleController; Library = new Library(this); }
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(); }
public PeopleControllerTest() { _peopleService = new MockPeopleService(); _controller = new PeopleController(_peopleService); }
public PeopleControllerTests() { _mockPeopleBuilder = new Mock <IModelBuilder <string, Data.Models.People> >(); _peopleController = new PeopleController(_mockPeopleBuilder.Object); }
public void Init() { Controller = new PeopleController(); }
public void TestGetPeople() { PeopleController controller = new PeopleController(); Assert.IsNotNull(controller.GetPerson(1)); }
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"); }
public PeopleControllerTests() { _controller = new PeopleController(_mockBenefitsService.Object, _mockCouncilTaxService.Object); }
public PeopleControllerTest() { _peopleController = new PeopleController(_repo, _userManager); }
public void Initialize() { _repositoryMock = new Mock <IPeopleRepository>(); _controller = new PeopleController(_repositoryMock.Object); }