static void AssertNoLineNumber(string className, string methodName) { var sourceLocationProvider = new SourceLocationProvider(TestAssemblyPath); var success = sourceLocationProvider.TryGetSourceLocation(className, methodName, out var location); success.ShouldBe(false); location.ShouldBe(null); }
static void AssertNoLineNumber(string className, string methodName) { var sourceLocationProvider = new SourceLocationProvider(TestAssemblyPath); SourceLocation location; var success = sourceLocationProvider.TryGetSourceLocation(new MethodGroup(className + "." + methodName), out location); success.ShouldBeFalse(); location.ShouldBeNull(); }
static void AssertLineNumber(string className, string methodName, int expectedLine) { var sourceLocationProvider = new SourceLocationProvider(TestAssemblyPath); var success = sourceLocationProvider.TryGetSourceLocation(className, methodName, out var location); success.ShouldBe(true); location.CodeFilePath.EndsWith("SourceLocationSamples.cs").ShouldBe(true); location.LineNumber.ShouldBe(expectedLine); }
static void AssertLineNumber(string className, string methodName, int debugLine, int releaseLine) { var sourceLocationProvider = new SourceLocationProvider(TestAssemblyPath); SourceLocation location; var success = sourceLocationProvider.TryGetSourceLocation(new MethodGroup(className + "." + methodName), out location); location.CodeFilePath.EndsWith("SourceLocationSamples.cs").ShouldBeTrue(); #if DEBUG location.LineNumber.ShouldEqual(debugLine); #else location.LineNumber.ShouldEqual(releaseLine); #endif }