public void GetQueriesByIdTest() { // Arrange //Mock Input User userInfo = new User { FacilityId = 11672, UserId = 12 }; //Mock Output List <ClaimSelector> expectedResult = new List <ClaimSelector> { new ClaimSelector { QueryName = "TestQuery", QueryId = 12 } }; // Act Mock <IReportSelectionRepository> mockReportSelectionRepository = new Mock <IReportSelectionRepository>(); mockReportSelectionRepository.Setup(f => f.GetQueriesById(userInfo)).Returns(expectedResult); ReportSelectionLogic target = new ReportSelectionLogic(mockReportSelectionRepository.Object); List <ClaimSelector> actual = target.GetQueriesById(userInfo); // Assert Assert.AreEqual(expectedResult, actual); Assert.AreEqual(expectedResult.Count, actual.Count); Assert.AreEqual(expectedResult[0].QueryName, actual[0].QueryName); Assert.AreEqual(expectedResult[0].QueryId, actual[0].QueryId); }
public void GetQueriesByIdNullTest() { // Arrange //Mock Output List <ClaimSelector> expectedResult = new List <ClaimSelector>(); // Act Mock <IReportSelectionRepository> mockReportSelectionRepository = new Mock <IReportSelectionRepository>(); mockReportSelectionRepository.Setup(f => f.GetQueriesById(null)).Returns(expectedResult); ReportSelectionLogic target = new ReportSelectionLogic(mockReportSelectionRepository.Object); List <ClaimSelector> actual = target.GetQueriesById(null); // Assert Assert.AreEqual(expectedResult, actual); Assert.AreEqual(expectedResult.Count, actual.Count); }
public List <ClaimSelector> GetQueriesById(User userInfo) { return(_reportSelectionLogic.GetQueriesById(userInfo)); }