public void MutantAllocationOverwritesOriginal_ResultEqualsMutant() { // Given var mutation = MockPodA.GetMutantPodA(); var fooAllocation = MockAllocation.GetTestAllocation(); // When AllocationProvider.SetPodAllocation(fooAllocation.PodA, mutation.AsPod); // Then Assert.True(EqualMethods.PodStoreEqual(mutation, fooAllocation.PodA)); }
public void MutantAllocationOverwritesOriginal_ResultEqualsMutant() { // Given var mutation = MockSeniorTeam.GetMutantSeniorTeam(); var fooAllocation = MockAllocation.GetTestAllocation(); // When AllocationProvider.SetSeniorTeamAllocation(fooAllocation.SeniorTeam, mutation.AsSeniorTeam); // Then Assert.True(EqualMethods.SeniorTeamStoreEqual(mutation, fooAllocation.SeniorTeam)); }
private void NullTeam_BadRequest() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); // When var nullRes = fooController.GetTeam(null); // Then Assert.IsType <BadRequestObjectResult>(nullRes); }
private void NullAllocationToValidPod_BadRequest() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); // When var nullAllocRes = fooController.AddAllocationToPod(TeamType.A, null); // Then Assert.IsType <BadRequestObjectResult>(nullAllocRes); }
private void ValidAllocation_Ok() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); var fooNewSeniorAllocation = new SeniorAllocationRequest(MockSeniorTeam.GetMutantSeniorTeam().AsSeniorTeam); // When var seniorRes = fooController.AddAllocationToSeniorTeam(fooNewSeniorAllocation); // Then Assert.IsType <OkObjectResult>(seniorRes); }
private void ValidAllocationToValidPod_Success() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); var fooNewAllocation = new PodAllocationRequest(MockPodD.GetTestPodD().AsPod); // When var successRes = fooController.AddAllocationToPod(TeamType.A, fooNewAllocation); // Then Assert.IsType <JsonResult>(successRes); }
private void ValidAllocationToNullPod_BadRequest() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); var fooNewAllocation = new PodAllocationRequest(MockPodD.GetTestPodD().AsPod); // When var nullTypeRes = fooController.AddAllocationToPod(null, fooNewAllocation); // Then Assert.IsType <BadRequestObjectResult>(nullTypeRes); }
public void Pod_Success() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); // When var podRes = fooController.GetTeam(TeamType.A); // Then var jsonPodRes = Assert.IsType <JsonResult>(podRes); var podSummaryResponse = Assert.IsType <TeamSummaryResponse>(jsonPodRes.Value); Assert.Equal(ResponseStatus.Success, podSummaryResponse.Status); }
public void ValidList_Success() { // Given var fooAllocation = MockAllocation.GetTestAllocation(); var fooProvider = new AllocationProvider(fooAllocation); var fooController = new TeamController(fooProvider); // When var res = fooController.GetTeamList(); // Then var jsonResult = Assert.IsType <JsonResult>(res); var teamListResponse = Assert.IsType <TeamListResponse>(jsonResult.Value); Assert.Equal(ResponseStatus.Success, teamListResponse.Status); }