Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyMothra committed Sep 27, 2023
1 parent 546b8dc commit eb7a769
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ public void TestNullMethodInfoInStack()
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.

// In AOT, StackFrame.GetMethod() can return null.
// In this instance, we fall back to StackFrame.ToString()
frameMock.Setup(x => x.ToString()).Returns("MethodName + 0x00 at offset 000 in file:line:column <filename unknown>:0:0");

Models.StackFrame stackFrame = new Models.StackFrame(frameMock.Object, 0);

Assert.Equal("unknown", stackFrame.Assembly);
Assert.Null(stackFrame.FileName);
Assert.Equal("unknown", stackFrame.Method);
Assert.Equal("MethodName + 0x00 at offset 000 in file:line:column <filename unknown>:0:0", stackFrame.Method);
Assert.Null(stackFrame.Line);
}

Expand Down

0 comments on commit eb7a769

Please sign in to comment.