public void Test_RenderData_AuthorEqualsNullIfPageAndSiteAreNull()
    {
        var file = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData
            {
            }
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData });
        var sut          = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Author.Should().BeNull();
    }
    public void Test_RenderData_TitleEqualsPageTitleIfExists()
    {
        var siteInfo = new SiteInfo();
        var file     = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData {
                { "title", "1" }
            }
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData });
        var sut          = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Title.Should().Be("1");
    }
    public void Test_RenderData_ContentEqualsEmptyStringWhenPageContentIsNull()
    {
        var siteInfo = new SiteInfo();
        var file     = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData
            {
            },
            Content = null
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData });
        var sut          = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Content.Should().Be(string.Empty);
    }
    public void Test_RenderData_LanguageEqualsSiteTitleIfExists()
    {
        var file = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData
            {
            }
        };
        var PageMetaData = file.ToPage();
        var SiteMetaData = new SiteMetaData(new PageMetaData[] { PageMetaData })
        {
            Language = "2"
        };
        var sut = new RenderData {
            Site = SiteMetaData, Page = PageMetaData
        };

        sut.Should().NotBeNull();
        sut.Language.Should().Be("2");
    }
    public async Task Test_FeedPlugin_ResultsInEmptyTags()
    {
        var fileSystemMock       = new FileSystemMock();
        var metadataProviderMock = new YamlFrontMatterMetadataProvider(new YamlParser());
        var pluginUnderTest      = new SeoPlugin();
        var configuration        = new ConfigurationBuilder().Build();
        var serviceProvider      = new ServiceCollection()
                                   .AddTransient <IPlugin>(_ => pluginUnderTest)
                                   .AddTransformationEngine(configuration)
                                   .AddSingleton(fileSystemMock.Object)
                                   .AddSingleton <IMetadataProvider>(metadataProviderMock)
                                   .BuildServiceProvider();
        var engine = serviceProvider.GetRequiredService <ITransformationEngine>();

        var file = new Kaylumah.Ssg.Manager.Site.Service.Files.Processor.File()
        {
            MetaData = new FileMetaData
            {
            }
        };
        var PageMetaData = file.ToPage();

        PageMetaData.Content = $"{{{{ {pluginUnderTest.Name} }}}}";

        var model = new RenderData()
        {
            Page = PageMetaData
        };
        var renderResult = await engine.Render(new MetadataRenderRequest[] {
            new MetadataRenderRequest {
                Metadata = model
            }
        });

        renderResult.Should().NotBeNull();
        renderResult.Length.Should().Be(1);

        var renderContent = renderResult[0].Content;

        renderContent.Should().NotBeEmpty();
    }