Ejemplo n.º 1
0
        public void CanGenerateLinksForSimpleClass()
        {
            LinkPopulator linkPopulator = new LinkPopulator(linkGenerators);
            var           simpleModel   = new SimpleModel();

            linkPopulator.PopulateLinks(simpleModel);

            Assert.That(simpleModel.Links.Length, Is.EqualTo(2));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }