コード例 #1
0
        public void given_deactivated_when_dectivate_then_fails(Guid id, string name)
        {
            var itemBL = new InventoryItemLogic(id, name);

            itemBL.Deactivate();
            itemBL.MarkChangesAsCommitted();

            Assert.Throws <InvalidOperationException>(() => itemBL.Deactivate());
        }
コード例 #2
0
        public void given_created_when_add_then_create_message_correct(Guid id, string name, int count)
        {
            var itemBL = new InventoryItemLogic(id, name);

            itemBL.MarkChangesAsCommitted();

            itemBL.CheckIn(count, 0.1f);

            var events         = itemBL.GetUncommittedChanges();
            var checkedInEvent = events.First() as ItemsCheckedInToInventory;

            Assert.Equal(id, checkedInEvent.Id);
            Assert.Equal(count, checkedInEvent.Count);
        }