Exemple #1
0
        public void IncludeUpdateTest()
        {
            var invoiceBuilder   = new InvoiceAggregateBuilder();
            var invoiceAggregate = invoiceBuilder.GetRandomInvoiceAggregate();
            var invoice          = InvoiceAggregate.Update(invoiceAggregate.Id, invoiceAggregate);

            invoiceAggregate.Should().BeEquivalentTo(invoice);
        }
Exemple #2
0
        public void IncludeSheetsTest()
        {
            var          invoiceBuilder = new InvoiceAggregateBuilder();
            int          numOfSheets    = 3;
            var          sheetBuilder   = new SheetAggregateBuilder();
            List <Sheet> TestSheets     = new List <Sheet>();

            for (int i = 0; i < numOfSheets; i++)
            {
                TestSheets.Add(sheetBuilder.CreateRandomSheet());
            }

            var invoiceAggregate = invoiceBuilder.GetRandomInvoiceAggregate();

            invoiceAggregate.IncludeSheets(TestSheets);

            Money sum = Money.FromDeciaml(numOfSheets * sheetBuilder.amountForRandomSheets * 150);

            invoiceAggregate.Sheets.Should().BeEquivalentTo(TestSheets);
            invoiceAggregate.Sum.Should().BeEquivalentTo(sum);
        }