Exemplo n.º 1
0
        public async Task GetUsersSampleSetsByIDAsync_ShouldReturnNotFound_WhenUserSampleSetsIsInvalid()
        {
            UsersSampleSets usersSampleSets = null;
            int             id = -2;

            _projectBLMock.Setup(i => i.GetUsersSampleSetsByIDAsync(id)).ReturnsAsync(usersSampleSets);
            UsersSampleSetsController usersSampleSetsController = new UsersSampleSetsController(_projectBLMock.Object);

            var result = await usersSampleSetsController.GetUsersSampleSetsByIDAsync(id);

            Assert.IsType <NotFoundResult>(result);
        }
Exemplo n.º 2
0
        public async Task GetUsersSampleSetsByIDAsync_ShouldReturnOkObjectResult_WhenIDIsValid()
        {
            UsersSampleSets usersSampleSets = new UsersSampleSets();
            int             id = 1;

            _projectBLMock.Setup(i => i.GetUsersSampleSetsByIDAsync(id)).ReturnsAsync(usersSampleSets);
            UsersSampleSetsController usersSampleSetsController = new UsersSampleSetsController(_projectBLMock.Object);

            var result = await usersSampleSetsController.GetUsersSampleSetsByIDAsync(id);

            Assert.IsType <OkObjectResult>(result);
        }