public void GetServiceLineTableSelectionifNotNull() { //Mock input ContractServiceLineTableSelection contractServiceLineTableSelectionDetails = new ContractServiceLineTableSelection { ContractId = 124589, ServiceLineTypeId = 1 }; //Mock Output List <ContractServiceLineTableSelection> contractServiceLineTableSelection = new List <ContractServiceLineTableSelection> { new ContractServiceLineTableSelection { ContractId = 124589, ContractServiceLineTableSelectionId = 13698 }, new ContractServiceLineTableSelection { ContractId = 124589, ContractServiceLineTableSelectionId = 1369636 }, }; //Mock setup var mockGetServiceLineTableSelection = new Mock <IServiceLineTableSelectionRepository>(); mockGetServiceLineTableSelection.Setup(f => f.GetServiceLineTableSelection(contractServiceLineTableSelectionDetails)).Returns(contractServiceLineTableSelection); ServiceLineTableSelectionLogic target = new ServiceLineTableSelectionLogic(mockGetServiceLineTableSelection.Object); List <ContractServiceLineTableSelection> actual = target.GetServiceLineTableSelection(contractServiceLineTableSelectionDetails); Assert.AreEqual(2, actual.Count); }
public void GetServiceLineTableSelectionifNull() { //Mock input ContractServiceLineTableSelection contractServiceLineTableSelectionDetails = null; //Mock Output //Mock setup var mockGetServiceLineTableSelection = new Mock <IServiceLineTableSelectionRepository>(); mockGetServiceLineTableSelection.Setup(f => f.GetServiceLineTableSelection(contractServiceLineTableSelectionDetails)).Returns((List <ContractServiceLineTableSelection>)null); ServiceLineTableSelectionLogic target = new ServiceLineTableSelectionLogic(mockGetServiceLineTableSelection.Object); List <ContractServiceLineTableSelection> actual = target.GetServiceLineTableSelection(null); Assert.IsNull(actual); }
public List <ContractServiceLineTableSelection> GetServiceLineTableSelection(ContractServiceLineTableSelection contractServiceLineTableSelection) { return(_serviceLineTableSelectionDetailsLogic.GetServiceLineTableSelection(contractServiceLineTableSelection)); }