Пример #1
0
        public void RestoredItem_ChangesState_ToPreviousState()
        {
            item.State = ContentState.Published;

            TrashHandler th = CreateTrashHandler();

            th.Throw(item);
            th.Restore(item);

            Assert.That(item.State, Is.EqualTo(ContentState.Published));
        }
Пример #2
0
        public void Drafts_AreNotPublished_WhenRestored()
        {
            TrashHandler th = CreateTrashHandler();

            item.State = ContentState.Draft;

            th.Throw(item);

            th.Restore(item);

            item.State.ShouldBe(ContentState.Draft);
        }
Пример #3
0
        public void ChildrenOf_RestoredItems_AreUnExpired()
        {
            TrashHandler th = CreateTrashHandler();

            var child1 = CreateItem <ThrowableItem>(5, "child1", item);
            var child2 = CreateItem <ThrowableItem>(6, "child2", child1);

            th.Throw(item);

            th.Restore(item);

            Assert.That(child1.Expires, Is.Null);
            Assert.That(child2.Expires, Is.Null);
        }
Пример #4
0
        public void DraftChildren_AreNotPublished_WhenRestored()
        {
            TrashHandler th = CreateTrashHandler();

            var child1 = CreateItem <ThrowableItem>(5, "child1", item);

            child1.State = ContentState.Draft;

            th.Throw(item);

            th.Restore(item);

            child1.State.ShouldBe(ContentState.Draft);
        }
Пример #5
0
        public void ChildrenOf_RestoredItems_AreUnExpired()
        {
            TrashHandler th = CreateTrashHandler();

            var child1 = CreateItem <ThrowableItem>(5, "child1", item);
            var child2 = CreateItem <ThrowableItem>(6, "child2", child1);

            th.Throw(item);

            th.Restore(item);

            child1.State.ShouldBe(ContentState.Published);
            child2.State.ShouldBe(ContentState.Published);
        }