Esempio n. 1
0
        public void EditQueryNameWithoutQueryIdUnitTest()
        {
            // Arrange
            const int     expectedResult = 1;
            ClaimSelector claimSelector  = new ClaimSelector
            {
                UserId         = 3421,
                FacilityId     = 1,
                UserName       = "******",
                FacilityName   = "SSI Demo Hospital",
                QueryId        = 0,
                QueryName      = "Q1011",
                SelectCriteria = "54|3|21~2|3|131"
            };
            //Mock setup
            Mock <IReportSelectionRepository> mockReportSelectionRepository = new Mock <IReportSelectionRepository>();

            mockReportSelectionRepository.Setup(x => x.AddEditQueryName(It.IsAny <ClaimSelector>())).Returns(expectedResult);
            ReportSelectionLogic target = new ReportSelectionLogic(mockReportSelectionRepository.Object);
            //Act
            int actual = target.AddEditQueryName(claimSelector);

            //Assert
            Assert.AreEqual(expectedResult, actual);
        }
Esempio n. 2
0
        public void AddQueryNameIfNullUnitTest()
        {
            // Arrange
            const int expectedResult = -1;
            //Mock setup
            Mock <IReportSelectionRepository> mockReportSelectionRepository = new Mock <IReportSelectionRepository>();

            mockReportSelectionRepository.Setup(x => x.AddEditQueryName(It.IsAny <ClaimSelector>())).Returns(expectedResult);
            ReportSelectionLogic target = new ReportSelectionLogic(mockReportSelectionRepository.Object);
            //Act
            int actual = target.AddEditQueryName(null);

            //Assert
            Assert.AreEqual(expectedResult, actual);
        }
 public int AddEditQueryName(ClaimSelector claimSelection)
 {
     return(_reportSelectionLogic.AddEditQueryName(claimSelection));
 }