示例#1
0
 public void CanCopyItem()
 {
     StartPage startPage = new StartPage();
     Page page = new Page();
     bool canCopy = integrityManger.CanCopy(page, startPage);
     Assert.IsTrue(canCopy, "The page couldn't be copied to the destination.");
 }
示例#2
0
        public void CanCopyItemEvent()
        {
            StartPage startPage = new StartPage();
            Page page = new Page();

            copying.Raise(persister, new CancellableDestinationEventArgs(page, startPage));
        }
示例#3
0
        public void CanDelete()
        {
            Page page = new Page();

            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);
        }
示例#4
0
 public void CanMoveItem()
 {
     StartPage startPage = new StartPage();
     Page page = new Page();
     bool canMove = integrityManger.CanMove(page, startPage);
     Assert.IsTrue(canMove, "The page couldn't be moved to the destination.");
 }
示例#5
0
        public void CanDeleteEvent()
        {
            Page page = new Page();

            mocks.Record();
            Expect.On(parser).Call(parser.IsRootOrStartPage(page)).Return(false);
            mocks.Replay(parser);

            deleting.Raise(persister, new CancellableItemEventArgs(page));

            mocks.Verify(parser);
        }
示例#6
0
 public void CannotMoveItemOntoItself()
 {
     Page page = new Page();
     bool canMove = integrityManger.CanMove(page, page);
     Assert.IsFalse(canMove, "The page could be moved onto itself.");
 }
示例#7
0
        public void CannotMoveItemOntoItselfEvent()
        {
            Page page = new Page();

            ExceptionAssert.Throws<DestinationOnOrBelowItselfException>(delegate
            {
                moving.Raise(persister, new CancellableDestinationEventArgs(page, page));
            });
        }
示例#8
0
        public void CannotMoveItemBelowItselfEvent()
        {
            Page page = new Page();
            Page page2 = CreateOneItem<Page>(2, "Rutger", page);

            ExceptionAssert.Throws<DestinationOnOrBelowItselfException>(delegate
            {
                moving.Raise(persister, new CancellableDestinationEventArgs(page, page2));
            });
        }
示例#9
0
        public void CannotMoveItemBelowItself()
        {
            Page page = new Page();
            Page page2 = CreateOneItem<Page>(2, "Rutger", page);

            bool canMove = integrityManger.CanMove(page, page2);
            Assert.IsFalse(canMove, "The page could be moved below itself.");
        }
示例#10
0
        public void CannotMoveIfTypeIsntAllowedEvent()
        {
            StartPage startPage = new StartPage();
            Page page = new Page();

            ExceptionAssert.Throws<NotAllowedParentException>(delegate
            {
                moving.Raise(persister, new CancellableDestinationEventArgs(startPage, page));
            });
        }
示例#11
0
        public void CannotMoveIfTypeIsntAllowed()
        {
            StartPage startPage = new StartPage();
            Page page = new Page();

            bool canMove = integrityManger.CanMove(startPage, page);
            Assert.IsFalse(canMove, "The start page could be moved even though a page isn't an allowed destination.");
        }
示例#12
0
        public void CannotCreate_ItemBelow_UnallowedParent()
        {
            var page = new Page();

            ExceptionAssert.Throws<NotAllowedParentException>(delegate
            {
                var neverReturned = definitions.CreateInstance<StartPage>(page);
            });
        }