コード例 #1
0
            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);
            }
コード例 #2
0
            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);
            }
コード例 #3
0
            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);
            }