Exemplo n.º 1
0
        public async Task GetUsersSampleSetsByUserIDAsync_ShouldReturnNotFound_WhenUserSampleSetsIsInvalid()
        {
            List <UsersSampleSets> usersSampleSets = null;
            int id = -21;

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

            var result = await usersSampleSetsController.GetUsersSampleSetsByUserIDAsync(id);

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

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

            var result = await usersSampleSetsController.GetUsersSampleSetsByUserIDAsync(id);

            Assert.IsType <OkObjectResult>(result);
        }