public async Task SearchUserRepository_GetFilteredUsers_SearchByStateCode_ShouldReturnProperResults_Test1() { searchDetail.StateCode = "NJ"; searchDetail.SearchCriteriaEnum = SearchCriteria.State; var results = await searchSearchUserRepository.GetFilteredUsers(searchDetail); Assert.AreEqual(4, results.Count); }
public async Task SearchUserController_GetByState_ValidState_ThrowsNoException() { // Arrange A.CallTo(() => fakeUserRepository.GetFilteredUsers(fakeSearchDetail)).Returns(userList); A.CallTo(() => fakeUserRepository.GetAllStates()).Returns(stateList); string stateCode = "NJ"; // Act searchUserController = new SearchUserController(fakeUserRepository, mapper, fakeSearchDetail, fakeMemoryCache, fakeLogger); actionResult = await searchUserController.GetByState(stateCode); okResult = actionResult as OkObjectResult; //Assert Assert.IsNotNull(okResult); }