예제 #1
0
        public ImportRefundTransactionTests()
        {
            transactionRepository = A.Fake <IImportNotificationTransactionRepository>();
            transactionCalculator = A.Fake <IImportNotificationTransactionCalculator>();
            assessmentRepository  = A.Fake <IImportNotificationAssessmentRepository>();
            refundTransaction     = new ImportRefundTransaction(transactionRepository, transactionCalculator, assessmentRepository);
            notificationId        = new Guid("DB476D01-2870-4322-8284-520B34D9667B");

            A.CallTo(() => transactionCalculator.TotalPaid(notificationId)).Returns(100);
            A.CallTo(() => transactionRepository.GetTransactions(notificationId))
            .Returns(new[]
            {
                ImportNotificationTransaction.PaymentRecord(notificationId, new DateTime(2015, 12, 1), 100,
                                                            PaymentMethod.Cheque, "12345", "comments"),
            });

            var assessment = new ImportNotificationAssessment(notificationId);

            A.CallTo(() => assessmentRepository.GetByNotification(notificationId))
            .Returns(assessment);

            SystemTime.Freeze(new DateTime(2016, 1, 1));
        }
 private ImportNotificationTransaction CreateNotificationTransaction(int credit, DateTime date)
 {
     return(ImportNotificationTransaction.PaymentRecord(notificationId, date, credit,
                                                        PaymentMethod.Card, null, null));
 }