public void GetChildIdsReturnsEmptyListIfNoItemFound( [Greedy] FakeDataProvider sut, ItemDefinition itemDefinition, CallContext context) { sut.GetChildIDs(itemDefinition, context).Should().BeEmpty(); }
public void GetChildIdsThrowsIfItemDefinitionIsNull( [Greedy] FakeDataProvider sut, CallContext context) { Action action = () => sut.GetChildIDs(null, context); action.ShouldThrow <ArgumentNullException>().WithMessage("*itemDefinition"); }
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); }