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); }
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); }