public void CanCopyItemEvent() { IntegrityStartPage startPage = new IntegrityStartPage(); IntegrityPage page = new IntegrityPage(); copying.Raise(persister, new CancellableDestinationEventArgs(page, startPage)); }
public void CanCopyItem() { IntegrityStartPage startPage = new IntegrityStartPage(); IntegrityPage page = new IntegrityPage(); bool canCopy = integrityManger.CanCopy(page, startPage); Assert.IsTrue(canCopy, "The page couldn't be copied to the destination."); }
public void CanDeleteEvent() { IntegrityPage page = new IntegrityPage(); mocks.Record(); Expect.On(parser).Call(parser.IsRootOrStartPage(page)).Return(false); mocks.Replay(parser); deleting.Raise(persister, new CancellableItemEventArgs(page)); mocks.Verify(parser); }
public void CanDelete() { IntegrityPage page = new IntegrityPage(); mocks.Record(); Expect.On(parser).Call(parser.IsRootOrStartPage(page)).Return(false); mocks.Replay(parser); bool canDelete = integrityManger.CanDelete(page); Assert.IsTrue(canDelete, "Page couldn't be deleted"); mocks.Verify(parser); }
public void CanMoveItem() { IntegrityStartPage startPage = new IntegrityStartPage(); IntegrityPage page = new IntegrityPage(); bool canMove = integrityManger.CanMove(page, startPage); Assert.IsTrue(canMove, "The page couldn't be moved to the destination."); }
public void CannotCreate_ItemBelow_UnallowedParent() { var page = new IntegrityPage(); // Doesn't throw activator.CreateInstance<IntegrityStartPage>(page); }
public void CannotCopyIfTypeIsntAllowedEvent() { IntegrityStartPage startPage = new IntegrityStartPage(); IntegrityPage page = new IntegrityPage(); ExceptionAssert.Throws<NotAllowedParentException>(delegate { copying.Raise(persister, new CancellableDestinationEventArgs(startPage, page)); }); }
public void CannotCopyIfTypeIsntAllowed() { IntegrityStartPage startPage = new IntegrityStartPage(); IntegrityPage page = new IntegrityPage(); bool canCopy = integrityManger.CanCopy(startPage, page); Assert.IsFalse(canCopy, "The start page could be copied even though a page isn't an allowed destination."); }
public void CannotMoveItemBelowItselfEvent() { IntegrityPage page = new IntegrityPage(); IntegrityPage page2 = CreateOneItem<IntegrityPage>(2, "Rutger", page); ExceptionAssert.Throws<DestinationOnOrBelowItselfException>(delegate { moving.Raise(persister, new CancellableDestinationEventArgs(page, page2)); }); }
public void CannotMoveItemBelowItself() { IntegrityPage page = new IntegrityPage(); IntegrityPage page2 = CreateOneItem<IntegrityPage>(2, "Rutger", page); bool canMove = integrityManger.CanMove(page, page2); Assert.IsFalse(canMove, "The page could be moved below itself."); }
public void CannotMoveItemOntoItself() { IntegrityPage page = new IntegrityPage(); bool canMove = integrityManger.CanMove(page, page); Assert.IsFalse(canMove, "The page could be moved onto itself."); }
public void CannotCreate_ItemBelow_UnallowedParent() { var page = new IntegrityPage(); ExceptionAssert.Throws<NotAllowedParentException>(delegate { var neverReturned = activator.CreateInstance<IntegrityStartPage>(page); }); }