Example #1
0
        public void ShouldHaveStandardBaseTemplate([Greedy] FakeDataProvider sut, [NoAutoProperties] DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            var result = sut.GetTemplates(null).First();

            result.BaseIDs.Single().Should().Be(TemplateIDs.StandardTemplate);
        }
Example #2
0
        public void ShouldGetTemplatesWithDefaultDataSectionFromDataStorage([Greedy] FakeDataProvider sut, DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            var result = sut.GetTemplates(null).First();

            result.GetSection("Data").Should().NotBeNull();
        }
Example #3
0
        public void ShouldGetTemplateFields([Greedy] FakeDataProvider sut, DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            template.Fields.Add("Title");
            var result = sut.GetTemplates(null).First();

            result.GetField("Title").Should().NotBeNull();
        }
Example #4
0
        public void ShouldGetTemplateFieldSource([Greedy] FakeDataProvider sut, DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            template.Fields.Add(new DbField("Multilist")
            {
                Source = "/sitecore/content"
            });
            var result = sut.GetTemplates(null).First();

            result.GetField("Multilist").Source.Should().Be("/sitecore/content");
        }
Example #5
0
        public void ShouldGetTemplateFieldIsShared([Greedy] FakeDataProvider sut, DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            template.Fields.Add(new DbField("Title")
            {
                Shared = true
            });
            var result = sut.GetTemplates(null).First();

            result.GetField("Title").IsShared.Should().BeTrue();
        }
Example #6
0
        public void ShouldGetTemplateFieldType([Greedy] FakeDataProvider sut, DbTemplate template)
        {
            sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
            template.Fields.Add(new DbField("Link")
            {
                Type = "General Link"
            });
            var result = sut.GetTemplates(null).First();

            result.GetField("Link").Type.Should().Be("General Link");
        }
Example #7
0
 public void ShouldGetTemplatesFromDataStorage([Greedy] FakeDataProvider sut, DbTemplate template)
 {
     sut.DataStorage.GetFakeTemplates().Returns(new[] { template });
     sut.GetTemplates(null).Should().HaveCount(1);
 }