Example #1
0
        public void MatchesWalkthroughs_ByMetadataOrder_IgnoringCasing()
        {
            var src = DemoCodeFixtureBuilder.Initialize()
                .WithWalkthroughsNonStandardCasing()
                .Build();

            var dest = DemoFixtureBuilder.Initialize()
                .WithMultipleWalkthroughs()
                .Build();

            var result = Act(src, dest);

            AssertWalkthroughRangesAreInOrder(result.Walkthroughs);
        }
Example #2
0
        public void ThrowsException_WhenDuplicatedWalkthroughsInSource()
        {
            var src = DemoCodeFixtureBuilder.Initialize()
                .WithDuplicatedWalkthroughs()
                .Build();

            var dest = DemoFixtureBuilder.Initialize()
                .WithMultipleWalkthroughs()
                .Build();

            try
            {
                Act(src, dest);
                Assert.True(false, $"Should have thrown {nameof(InvalidOperationException)}.");
            }
            catch (InvalidOperationException)
            {
            }
        }
Example #3
0
        public void CopiesWalkthroughs()
        {
            var src = DemoCodeFixtureBuilder.Initialize()
                .WithMutlipleWalkthrougs()
                .Build();

            var dest = DemoFixtureBuilder.Initialize()
                .WithMultipleWalkthroughs()
                .Build();

            var result = Act(src, dest);

            Assert.All(result.Walkthroughs, w =>
            {
                var range = w.Lines;
                Assert.True(range.Start > 0);
                Assert.True(range.End > 0);
            });
        }
Example #4
0
        public void ThrowsException_WhenRegionIsMissingFromSource()
        {
            var src = DemoCodeFixtureBuilder.Initialize()
                .WithMissingWalkthroughs()
                .Build();

            var dest = DemoFixtureBuilder.Initialize()
                .WithMultipleWalkthroughs()
                .Build();

            try
            {
                Act(src, dest);
                Assert.True(false, $"Should have thrown {nameof(ParsingException)}.");
            }
            catch (ParsingException)
            {
            }
        }
Example #5
0
        public void ThrowsException_WhenNoSourceCodeProvided()
        {
            var src = DemoCodeFixtureBuilder.Initialize()
                .WithNullSourceCode()
                .WithMutlipleWalkthrougs()
                .Build();

            var dest = DemoFixtureBuilder.Initialize()
                .WithMultipleWalkthroughs()
                .Build();

            try
            {
                Act(src, dest);
                Assert.True(false, $"Should have thrown {nameof(ParsingException)}.");
            }
            catch (ParsingException)
            {
            }
        }