コード例 #1
0
        public void This_DoesNotThrowExceptions_WhenYamlStringIsNullOrEmpty(string yaml)
        {
            var frontMatter = new JournalFrontMatter(yaml, null);

            frontMatter.Tags.Should().BeNull();
            frontMatter.Readme.Should().BeNull();
            frontMatter.ReadmeDate.Should().BeNull();
            frontMatter.IsEmpty().Should().BeTrue();
        }
コード例 #2
0
        public void This_DoesNotThrowExceptions_WhenYamlIsNullOrEmptyButDateIsValid(string yaml)
        {
            var frontMatter = new JournalFrontMatter(yaml, Today.Date());

            frontMatter.Tags.Should().BeNull();
            frontMatter.Readme.Should().BeNull();
            frontMatter.ReadmeDate.Should().BeNull();
            frontMatter.IsEmpty().Should().BeTrue();
        }
コード例 #3
0
        public void This_DoesNotThrowExceptions_WhenTagsAndReadmeParserAreNull()
        {
            IEnumerable <string> tags             = null;
            ReadmeExpression     readmeExpression = null;
            var frontMatter = new JournalFrontMatter(tags, readmeExpression);

            frontMatter.Tags.Should().BeNull();
            frontMatter.Readme.Should().BeNull();
            frontMatter.ReadmeDate.Should().BeNull();
            frontMatter.IsEmpty().Should().BeTrue();
        }
コード例 #4
0
        public void This_ParsesLegacyReadmeValues_WhenPresent(string yaml, string entryDate, string readmeDate)
        {
            var journalDate = entryDate.ToLocalDate();
            var frontMatter = new JournalFrontMatter(yaml, journalDate);

            frontMatter.Tags.Should().Contain(new List <string> {
                "one", "two"
            });
            frontMatter.Readme.Should().Be(readmeDate);
            frontMatter.ReadmeDate.Should().Be(readmeDate.ToLocalDate());
            frontMatter.IsEmpty().Should().BeFalse();
        }