public void GetPaymentTypePerVisitDetailsMockTestIsNull() { var mockProductRepository = new Mock <IPaymentTypePerVisitRepository>(); mockProductRepository.Setup(f => f.GetPaymentTypePerVisitDetails(It.IsAny <PaymentTypePerVisit>())).Returns((PaymentTypePerVisit)null); PaymentTypePerVisitLogic target = new PaymentTypePerVisitLogic(mockProductRepository.Object); PaymentTypePerVisit actual = (PaymentTypePerVisit)target.GetPaymentType(null); Assert.IsNull(actual); // Assert.IsNotNull(actual); }
public void GetPaymentTypePerVisitDetailsMockTestIsNotNull() { PaymentTypePerVisit objPaymentTypeVisit = new PaymentTypePerVisit { PaymentTypeId = 1 }; var mockProductRepository = new Mock <IPaymentTypePerVisitRepository>(); mockProductRepository.Setup(f => f.GetPaymentTypePerVisitDetails(It.IsAny <PaymentTypePerVisit>())).Returns(objPaymentTypeVisit); PaymentTypePerVisitLogic target = new PaymentTypePerVisitLogic(mockProductRepository.Object); PaymentTypePerVisit actual = (PaymentTypePerVisit)target.GetPaymentType(objPaymentTypeVisit); Assert.AreEqual(1, actual.PaymentTypeId); }
public PaymentTypePerVisit GetPaymentTypePerVisitDetails(PaymentTypePerVisit paymentTypePerVisit) { return((PaymentTypePerVisit)_paymentTypePerVisitDetailsLogic.GetPaymentType(paymentTypePerVisit)); }