Пример #1
0
        public void Header_FileVersionValueAbsent_NoError()
        {
            var test   = new TestHelper();
            var text   = new HeaderContentBuilder().WithFileVersion(null).Build();
            var parser = test.Setup(text);

            parser.headerContent();

            test.ParserErrors.Should().BeEmpty();
        }
Пример #2
0
        public void Header_SeparatorValueAbsent_NoError()
        {
            var test   = new TestHelper();
            var text   = new HeaderContentBuilder().WithSeparator(string.Empty).Build();
            var parser = test.Setup(text);

            parser.headerContent();

            test.ParserErrors.Should().BeEmpty();
        }
Пример #3
0
        public void Header_FileVersionEntryAbsent_Error()
        {
            var test          = new TestHelper();
            var headerContent = new HeaderContentBuilder().WithoutFileVersion().Build();
            var parser        = test.Setup($"{OpgTags.HeaderStart}{headerContent}{OpgTags.HeaderEnd}");

            parser.header();

            test.ParserErrors.Should().Contain(
                x => x.Contains($"expecting '{OpgTags.FileVersion}'"));
        }
        public void HeaderContentVisitor_VersionAbsent_GetDefault()
        {
            var       test     = new TestHelper();
            const int expected = OpgDefaults.FileVersion;
            var       opgText  = new HeaderContentBuilder().WithFileVersion(null).Build();
            var       parser   = test.Setup(opgText);
            var       context  = parser.headerContent();
            var       sut      = new HeaderContentVisitor();

            var header = sut.VisitHeaderContent(context);

            header.FileVersion.Should().Be(expected);
        }
        public void HeaderContentVisitor_VersionProvided_GetValue()
        {
            var       test     = new TestHelper();
            const int expected = 13;
            var       opgText  = new HeaderContentBuilder().WithFileVersion(expected).Build();
            var       parser   = test.Setup(opgText);
            var       context  = parser.headerContent();
            var       sut      = new HeaderContentVisitor();

            var header = sut.VisitHeaderContent(context);

            header.FileVersion.Should().Be(expected);
        }
 public void HeaderContentVisitor_SeparatorProvided_GetValue()
 {
     var          test     = new TestHelper();
     const string expected = "@";
     var          opgText  = new HeaderContentBuilder().WithSeparator(expected).Build();
 }