示例#1
0
        public void DeleteItemReturnsTrueIfRemoved(
            [Greedy] FakeDataProvider sut,
            ItemDefinition itemDefinition,
            DbItem item)
        {
            sut.DataStorage.GetFakeItem(itemDefinition.ID).Returns(item);
            sut.DataStorage.RemoveFakeItem(item.ID).Returns(true);

            sut.DeleteItem(itemDefinition, null).Should().BeTrue();

            sut.DataStorage.Received().RemoveFakeItem(item.ID);
        }
示例#2
0
 public void DeleteItemReturnsFalseIfNoDbItemFound([Greedy] FakeDataProvider sut, ItemDefinition itemDefinition)
 {
     sut.DeleteItem(itemDefinition, null).Should().BeFalse();
 }
示例#3
0
        public void DeleteItemThrowsIfItemDefinitionIsNull(FakeDataProvider sut)
        {
            Action action = () => sut.DeleteItem(null, null);

            action.ShouldThrow <ArgumentNullException>().WithMessage("*itemDefinition");
        }