Ejemplo n.º 1
0
        public void RemoveItem()
        {
            var sut = new TestAggregate(100);

            sut.AddItem("Description", 1, 10.00, true);

            sut.RemoveItem(1);

            Assert.AreEqual(3, sut.Events.Count, "Events");
            Assert.AreEqual(3, sut.Version, "Version");
            Assert.AreEqual(0, sut.Items.Count, "Items");
        }
Ejemplo n.º 2
0
        public void AddItem()
        {
            var sut = new TestAggregate(100);

            sut.AddItem("Description", 1, 10.00, true);

            Assert.AreEqual(2, sut.Events.Count, "Events");
            Assert.AreEqual(2, sut.Version, "Version");
            Assert.AreEqual(1, sut.Items.Count, "Items");
            Assert.AreEqual("Description", sut.Items[0].Description, "Description");
            Assert.AreEqual(1, sut.Items[0].Quantity, "Quantity");
            Assert.AreEqual(10.00, sut.Items[0].Price, "Price");
            Assert.AreEqual(true, sut.Items[0].Taxable, "Taxable");
        }
Ejemplo n.º 3
0
        public void ChangeItem()
        {
            var sut = new TestAggregate(100);

            sut.AddItem("Description", 1, 10.00, true);

            sut.ChangeItem(1, "New Description");
            sut.ChangeItem(1, 10);

            Assert.AreEqual(4, sut.Events.Count, "Events");
            Assert.AreEqual(4, sut.Version, "Version");
            Assert.AreEqual(1, sut.Items.Count, "Items");
            Assert.AreEqual("New Description", sut.Items[0].Description, "Description");
            Assert.AreEqual(10, sut.Items[0].Quantity, "Quantity");
        }