Process() public method

public Process ( Sitecore.FakeDb.Pipelines.DsItemLoadingArgs args ) : void
args Sitecore.FakeDb.Pipelines.DsItemLoadingArgs
return void
    public void ProcessThrowsIfSyncItemIsNull()
    {
      var sut = new CopyParentId();
      var dsitem = Substitute.For<IDsDbItem>();
      var dataStorage = Substitute.For<DataStorage>(Database.GetDatabase("master"));
      var args = new DsItemLoadingArgs(dsitem, dataStorage);

      Action action = () => sut.Process(args);

      action.ShouldThrow<ArgumentNullException>().WithMessage("*SyncItem");
    }
    public void ProcessThrowsIfSyncItemParentIdIsNotIdentifier()
    {
      var sut = new CopyParentId();
      var dsitem = Substitute.For<IDsDbItem>();
      dsitem.SyncItem.Returns(new SyncItem { ParentID = "not an id" });
      var dataStorage = Substitute.For<DataStorage>(Database.GetDatabase("master"));
      var args = new DsItemLoadingArgs(dsitem, dataStorage);

      Action action = () => sut.Process(args);

      action.ShouldThrow<ArgumentException>().WithMessage("Unable to copy ParentId. Valid identifier expected.*");
    }
    public void ProcessIgnoresParentIdIfNoParentItemFound()
    {
      var sut = new CopyParentId();
      var dsitem = Substitute.For<IDsDbItem, DbItem>("item");
      var parentId = ID.NewID;
      dsitem.SyncItem.Returns(new SyncItem { ParentID = parentId.ToString() });
      var dataStorage = Substitute.For<DataStorage>(Database.GetDatabase("master"));
      var args = new DsItemLoadingArgs(dsitem, dataStorage);

      sut.Process(args);

      ((DbItem)dsitem).ParentID.Should().BeNull();
    }
 public void ProcessThrowsIfArgsIsNull()
 {
   var sut = new CopyParentId();
   Action action = () => sut.Process(null);
   action.ShouldThrow<ArgumentNullException>().WithMessage("*args");
 }