public void GetAllServiceLineCodesIfNotNull()
        {
            //Mock Input
            const long serviceLineTypeId = 1234;

            //Mock output
            List <ServiceLineCode> serviceLineCodeDetails = new List <ServiceLineCode>
            {
                new ServiceLineCode {
                    CodeString  = "Abc123",
                    Description = "Drug1"
                },
                new ServiceLineCode {
                    CodeString  = "Abc123",
                    Description = "Drug2"
                }
            };

            //Mock Setup
            var mockGetAllServiceLineCodes = new Mock <IServiceLineCodeRepository>();

            mockGetAllServiceLineCodes.Setup(f => f.GetAllServiceLineCodes(It.IsAny <long>(), 1, 10)).Returns(serviceLineCodeDetails);
            ServiceLineCodeLogic   target = new ServiceLineCodeLogic(mockGetAllServiceLineCodes.Object);
            List <ServiceLineCode> actual = target.GetAllServiceLineCodes(serviceLineTypeId, 1, 10);

            Assert.AreEqual(actual, serviceLineCodeDetails);
        }
 public List <ServiceLineCode> GetAllServiceLineCodes(ContractServiceLine input)
 {
     //TODO: From the controller we are sending an Nullable type, then till business & data layer same type should be send.
     // From controller we are sending long? and in business & data layer in signature is GetAllServiceLineCodes(long id )
     if (input != null)
     {
         if (input.ServiceLineId != null)
         {
             return(_serviceLineCodeDetailsLogic.GetAllServiceLineCodes(input.ServiceLineId.Value, input.PageSize, input.PageIndex));
         }
     }
     return(null);
 }