public ApproveFinancialGuaranteeHandlerTests()
        {
            context = new TestIwsContext();
            repository = A.Fake<IFinancialGuaranteeRepository>();

            var financialGuaranteeCollection = new TestFinancialGuaranteeCollection(ApplicationCompletedId);
            financialGuarantee = new TestFinancialGuarantee(FinancialGuaranteeId);
            financialGuarantee.SetStatus(FinancialGuaranteeStatus.ApplicationComplete);
            financialGuarantee.CompletedDate = FirstDate;
            financialGuaranteeCollection.AddExistingFinancialGuarantee(financialGuarantee);

            A.CallTo(() => repository.GetByNotificationId(ApplicationCompletedId)).Returns(financialGuaranteeCollection);

            var approval = new FinancialGuaranteeApproval(repository);

            handler = new ApproveFinancialGuaranteeHandler(approval, context);
        }
        public ApproveFinancialGuaranteeHandlerTests()
        {
            context    = new TestIwsContext();
            repository = A.Fake <IFinancialGuaranteeRepository>();

            var financialGuaranteeCollection = new TestFinancialGuaranteeCollection(ApplicationCompletedId);

            financialGuarantee = new TestFinancialGuarantee(FinancialGuaranteeId);
            financialGuarantee.SetStatus(FinancialGuaranteeStatus.ApplicationComplete);
            financialGuarantee.CompletedDate = FirstDate;
            financialGuaranteeCollection.AddExistingFinancialGuarantee(financialGuarantee);

            A.CallTo(() => repository.GetByNotificationId(ApplicationCompletedId)).Returns(financialGuaranteeCollection);

            var approval = new FinancialGuaranteeApproval(repository);

            handler = new ApproveFinancialGuaranteeHandler(approval, context);
        }
        public FinancialGuaranteeApprovalTests()
        {
            SystemTime.Freeze(today);

            repository = A.Fake<IFinancialGuaranteeRepository>();

            financialGuaranteeCollection = new FinancialGuaranteeCollection(notificationId);

            var approvedFinancialGuarantee = financialGuaranteeCollection.AddFinancialGuarantee(today.AddDays(-10));
            EntityHelper.SetEntityId(approvedFinancialGuarantee, approvedFinancialGuaranteeId);
            approvedFinancialGuarantee.Complete(today.AddDays(-9));
            approvedFinancialGuarantee.Approve(new ApprovalData(today.AddDays(-8), "123", 10, false));

            var newFinancialGuarantee = financialGuaranteeCollection.AddFinancialGuarantee(today.AddDays(-5));
            newFinancialGuarantee.Complete(today.AddDays(-4));
            EntityHelper.SetEntityId(newFinancialGuarantee, financialGuaranteeId);

            A.CallTo(() => repository.GetByNotificationId(notificationId)).Returns(financialGuaranteeCollection);

            approval = new FinancialGuaranteeApproval(repository);
        }
        public FinancialGuaranteeApprovalTests()
        {
            SystemTime.Freeze(today);

            repository = A.Fake <IFinancialGuaranteeRepository>();

            financialGuaranteeCollection = new FinancialGuaranteeCollection(notificationId);

            var approvedFinancialGuarantee = financialGuaranteeCollection.AddFinancialGuarantee(today.AddDays(-10));

            EntityHelper.SetEntityId(approvedFinancialGuarantee, approvedFinancialGuaranteeId);
            approvedFinancialGuarantee.Complete(today.AddDays(-9));
            approvedFinancialGuarantee.Approve(new ApprovalData(today.AddDays(-8), "123", 10, false, (decimal)12.34, (decimal)56.78));

            var newFinancialGuarantee = financialGuaranteeCollection.AddFinancialGuarantee(today.AddDays(-5));

            newFinancialGuarantee.Complete(today.AddDays(-4));
            EntityHelper.SetEntityId(newFinancialGuarantee, financialGuaranteeId);

            A.CallTo(() => repository.GetByNotificationId(notificationId)).Returns(financialGuaranteeCollection);

            approval = new FinancialGuaranteeApproval(repository);
        }
Exemplo n.º 5
0
 public ApproveFinancialGuaranteeHandler(FinancialGuaranteeApproval financialGuaranteeApproval, IwsContext context)
 {
     this.financialGuaranteeApproval = financialGuaranteeApproval;
     this.context = context;
 }