public void CanGenerateLinksForSimpleClass() { LinkPopulator linkPopulator = new LinkPopulator(linkGenerators); var simpleModel = new SimpleModel(); linkPopulator.PopulateLinks(simpleModel); Assert.That(simpleModel.Links.Length, Is.EqualTo(2)); }
public void CanGenerateLinksForSubPropertiesWithNoGeneratorForParent() { LinkPopulator linkPopulator = new LinkPopulator(linkGenerators); var complexModel = new ComplexModelWithNoGenerator() { SimpleModel = new SimpleModel() }; linkPopulator.PopulateLinks(complexModel); Assert.That(complexModel.SimpleModel.Links.Length, Is.EqualTo(2)); }
public void CanGenerateLinksForClassWithListProperty() { LinkPopulator linkPopulator = new LinkPopulator(linkGenerators); var complexModel = new ComplexModelWithList() { SimpleModel = new SimpleModel[] { new SimpleModel() } }; linkPopulator.PopulateLinks(complexModel); Assert.That(complexModel.Links.Length, Is.EqualTo(2)); Assert.That(complexModel.SimpleModel[0].Links.Length, Is.EqualTo(2)); }