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); }
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) { } }
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); }); }
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) { } }
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) { } }