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 AddNewClaimFieldSelectionIfNullLogicUnitTest()
        {
            ServiceLineClaimFieldLogic target = new ServiceLineClaimFieldLogic(Constants.ConnectionString);
            const long expected = 0;
            long       actual   = target.AddNewClaimFieldSelection(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);
        }
Пример #4
0
 //TODO: AddNewClaimFieldSelection AND EditClaimFieldSelection can be combined and read as AddEditClaimFieldSelection
 /// <summary>
 /// Adds the new claim field selection.
 /// </summary>
 /// <param name="claimFieldSelection">The claim field selection.</param>
 public long AddNewClaimFieldSelection(List <ContractServiceLineClaimFieldSelection> claimFieldSelection)
 {
     return(_serviceLineClaimFieldLogic.AddNewClaimFieldSelection(claimFieldSelection));
 }