Example #1
0
 public void GetChildIdsReturnsEmptyListIfNoItemFound(
     [Greedy] FakeDataProvider sut,
     ItemDefinition itemDefinition,
     CallContext context)
 {
     sut.GetChildIDs(itemDefinition, context).Should().BeEmpty();
 }
Example #2
0
        public void GetChildIdsThrowsIfItemDefinitionIsNull(
            [Greedy] FakeDataProvider sut,
            CallContext context)
        {
            Action action = () => sut.GetChildIDs(null, context);

            action.ShouldThrow <ArgumentNullException>().WithMessage("*itemDefinition");
        }
Example #3
0
        public void GetChildIdsReturnsChildIds(
            [Greedy] FakeDataProvider sut,
            ItemDefinition itemDefinition,
            DbItem parent,
            DbItem child1,
            DbItem child2,
            CallContext context)
        {
            sut.DataStorage.GetFakeItem(itemDefinition.ID).Returns(parent);
            parent.Children.Add(child1);
            parent.Children.Add(child2);
            var expected = new IDList {
                child1.ID, child2.ID
            };

            sut.GetChildIDs(itemDefinition, context).ShouldBeEquivalentTo(expected);
        }