public void CopyItemThrowsIfDestinationIsNull( FakeDataProvider sut, ItemDefinition source) { Action action = () => sut.CopyItem(source, null, null, ID.Null, null); action.ShouldThrow <ArgumentNullException>().Which.ParamName.Should().Be("destination"); }
public void CopyItemThrowsIfCopyIdIsNull( FakeDataProvider sut, ItemDefinition source, ItemDefinition destination, string copyName) { Action action = () => sut.CopyItem(source, destination, copyName, null, null); action.ShouldThrow <ArgumentNullException>().Which.ParamName.Should().Be("copyId"); }
public void CopyItemReturnsTrue( [Greedy] FakeDataProvider sut, ItemDefinition source, ItemDefinition destination, string copyName, ID copyId, CallContext context, DbItem sourceItem) { sut.DataStorage.GetFakeItem(source.ID).Returns(sourceItem); sut.CopyItem(source, destination, copyName, copyId, context) .Should().BeTrue(); }
public void CopyItemThrowsIfNoDestinationItemFound( [Greedy] FakeDataProvider sut, ItemDefinition source, ItemDefinition destination, string copyName, ID copyId, CallContext context) { Action action = () => sut.CopyItem(source, destination, copyName, copyId, context); action.ShouldThrow <InvalidOperationException>() .WithMessage("Unable to copy item '{0}'. The source item '{1}' is not found." .FormatWith(copyName, source.ID)); }
public void CopyItemAddsCopiedItemToDataStorage( [Greedy] FakeDataProvider sut, ItemDefinition source, ItemDefinition destination, string copyName, ID copyId, CallContext context, DbItem sourceItem) { sut.DataStorage.GetFakeItem(source.ID).Returns(sourceItem); sut.CopyItem(source, destination, copyName, copyId, context); sut.DataStorage.Received().AddFakeItem( Arg.Is <DbItem>(i => i.Name == copyName && i.ID == copyId && i.TemplateID == source.TemplateID && i.ParentID == destination.ID)); }
public void CopyItemThrowsIfSourceIsNull(FakeDataProvider sut) { Action action = () => sut.CopyItem(null, null, null, ID.Null, null); action.ShouldThrow <ArgumentNullException>().Which.ParamName.Should().Be("source"); }