BudgetAnalyser.Engine.UnitTest.Ledger.ReconciliationManagerTest_Reconcile.Reconcile_ShouldThrowValidationWarning_GivenTwoOrMoreWarningsHaveAlreadyBeenThrown C# (CSharp) Метод

Reconcile_ShouldThrowValidationWarning_GivenTwoOrMoreWarningsHaveAlreadyBeenThrown() приватный Метод

        public void Reconcile_ShouldThrowValidationWarning_GivenTwoOrMoreWarningsHaveAlreadyBeenThrown()
        {
            // First the statement has a transaction that is not classified with a bucket.
            this.testDataStatement = new StatementModelBuilder()
                .TestData1()
                .AppendTransaction(new Transaction
                {
                    Account = StatementModelTestData.ChequeAccount,
                    Amount = 12.45M,
                    Date = ReconcileDate.AddDays(-1),
                    Description = "Foo bar"
                })
                .Build();
            try
            {
                Act();
            }
            catch (ValidationWarningException ex)
            {
                if (ex.Source != "3") Assert.Fail();
            }

            // Second time thru, we choose to ignore validation warnings messages we've seen before.
            try
            {
                ActOnTestData5(ignoreWarnings: true);
            }
            catch (ValidationWarningException ex)
            {
                if (ex.Source == "2") return;
            }

            Assert.Fail();
        }