Beispiel #1
0
        ContractServiceLineClaimFieldSelectionController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _serviceLineClaimFieldLogic = new ServiceLineClaimFieldLogic(bubbleDataSource);
        }
        public void AddNewClaimFieldSelectionLogicUnitTestIfNotNull()
        {
            //Mock input
            List <ContractServiceLineClaimFieldSelection> contractServiceLineTableSelections = new List
                                                                                               <ContractServiceLineClaimFieldSelection>
            {
                new ContractServiceLineClaimFieldSelection
                {
                    ContractId
                        =
                            124589
                },
                new ContractServiceLineClaimFieldSelection
                {
                    ContractId
                        =
                            124589
                },
            };

            //Mock setup
            var mockAddServiceLineClaimandTables = new Mock <IServiceLineClaimFieldRepository>();

            mockAddServiceLineClaimandTables.Setup(f => f.AddNewClaimFieldSelection(contractServiceLineTableSelections))
            .Returns(1);
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(mockAddServiceLineClaimandTables.Object);

            long actual = target.AddNewClaimFieldSelection(contractServiceLineTableSelections);

            Assert.AreEqual(1, actual);
        }
        public void ServiceLineClaimFieldConstructorUnitTest2()
        {
            var mockAddNewClaimFieldSelectionCase = new Mock <IServiceLineClaimFieldRepository>();
            ServiceLineClaimFieldLogic target     = new ServiceLineClaimFieldLogic(mockAddNewClaimFieldSelectionCase.Object);

            Assert.IsInstanceOfType(target, typeof(ServiceLineClaimFieldLogic));
        }
        public void ServiceLineClaimFieldConstructorUnitTest1()
        {
            var target = new ServiceLineClaimFieldLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(ServiceLineClaimFieldLogic));
        }
        public void EditClaimFieldSelectionTest1()
        {
            //Mock input
            List <ContractServiceLineClaimFieldSelection> contractServiceLineTableSelection = new List
                                                                                              <ContractServiceLineClaimFieldSelection>
            {
                new ContractServiceLineClaimFieldSelection
                {
                    ContractId
                        = 1247
                },
                new ContractServiceLineClaimFieldSelection
                {
                    ContractId
                        = 1247
                },
            };


            //Mock setup
            var mockEditServiceLineTableSelection = new Mock <IServiceLineClaimFieldRepository>();

            mockEditServiceLineTableSelection.Setup(f => f.EditClaimFieldSelection(contractServiceLineTableSelection)).
            Returns(1);
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(mockEditServiceLineTableSelection.Object);

            long actual = target.EditClaimFieldSelection(contractServiceLineTableSelection);

            Assert.AreEqual(1, actual);
        }
        public void EditClaimFieldSelectionIfNullLogicUnitTest()
        {
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(Constants.ConnectionString);
            const long expected = 0;
            long       actual   = target.EditClaimFieldSelection(null);

            Assert.AreEqual(expected, actual);
        }
        public void AddNewClaimFieldSelectionTestNull()
        {
            var mockAddClaimFieldSelection = new Mock <IServiceLineClaimFieldRepository>();

            mockAddClaimFieldSelection.Setup(f => f.AddNewClaimFieldSelection(It.IsAny <List <ContractServiceLineClaimFieldSelection> >())).Returns(0);
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(mockAddClaimFieldSelection.Object);
            long actual = target.AddNewClaimFieldSelection(null);

            Assert.AreEqual(0, actual);
        }
        public void GetClaimFieldSelectionTestNull()
        {
            List <ContractServiceLineClaimFieldSelection> result = new List <ContractServiceLineClaimFieldSelection>();
            var mockGetClaimFieldSelection = new Mock <IServiceLineClaimFieldRepository>();

            mockGetClaimFieldSelection.Setup(f => f.GetClaimFieldSelection(null)).Returns(result);
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(mockGetClaimFieldSelection.Object);
            List <ContractServiceLineClaimFieldSelection> actual = target.GetClaimFieldSelection(null);

            Assert.AreEqual(result, actual);
        }