public void GetSourceLocation_Type_ReturnsCorrectFileNameIfTypeHasMethodsConstructorsOrProperties(Type type) { CodeLocation codeLocation = DebugSymbolUtils.GetSourceLocation(type); Assert.EndsWith(codeLocation.Path, GetType().Name + ".cs"); Assert.AreEqual(0, codeLocation.Line); Assert.AreEqual(0, codeLocation.Column); }
public void GetSourceLocation_Type_ReturnsUnknownIfAssemblyIsDynamic() { ILogger mockLogger = Mocks.StrictMock <ILogger>(); Mocks.ReplayAll(); Assert.AreEqual(CodeLocation.Unknown, DebugSymbolUtils.GetSourceLocation(mockLogger.GetType())); }
public void GetSourceLocation_Method_ReturnsValidLocationForConcreteMethod() { CodeLocation codeLocation = DebugSymbolUtils.GetSourceLocation(typeof(Sample).GetMethod("ConcreteMethod")); Assert.EndsWith(codeLocation.Path, GetType().Name + ".cs"); Assert.Between(codeLocation.Line, 1000, 1003); Assert.AreEqual(codeLocation.Column, 0, "No column information should be returned because it is inaccurate."); }
public void GetSourceLocation_Type_ReturnsUnknownIfTypeHasNoMembers() { Assert.AreEqual(CodeLocation.Unknown, DebugSymbolUtils.GetSourceLocation(typeof(EmptyType))); }
public void GetSourceLocation_Type_ThrowsIfTypeIsNull() { DebugSymbolUtils.GetSourceLocation((Type)null); }
public void GetSourceLocation_Method_ThrowsIfMethodIsNull() { DebugSymbolUtils.GetSourceLocation((MethodBase)null); }