public void ReturnsErrorForEmptyCity_Test() { target.GetEmployeeByLocation(string.Empty, "Washington"); var actual = target.Errors.Where(x => x.Contains("Invalid City")); Assert.AreEqual(1, actual.Count()); }
public void SetUp() { ExpectedCity = "TestCity"; ExpectedState = "Id"; Expected = new List <EmployeeDto> { new EmployeeDto(), new EmployeeDto(), new EmployeeDto() }; EmployeeRepositoryMock = new Mock <IEmployeeRepository>(); EmployeeRepositoryMock.Setup(x => x.GetEmployeeByCityState(ExpectedCity, ExpectedState)) .Returns(Expected); Target = new EmployeeRequests { EmployeeRepository = EmployeeRepositoryMock.Object }; Actual = Target.GetEmployeeByLocation(ExpectedCity, ExpectedState); }
public void Action(string city, string state) { MockEmployeeRepository.Setup(x => x.GetEmployeeByCityState(city, state)).Returns(Expected); target.EmployeeRepository = MockEmployeeRepository.Object; target.GetEmployeeByLocation(city, state); }