Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.
  • Loading branch information
jamescrosswell committed Jul 21, 2025
commit 16a54eeecda9bd161e23d30c5dc81d2ba1b86895
1 change: 0 additions & 1 deletion GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@
global using System.Security.Principal;
global using System.Text;
global using System.Text.RegularExpressions;
global using static VerifyXunit.Verifier;
3 changes: 2 additions & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<Using Include="NSubstitute.ReturnsExtensions" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
<Using Condition="'$(TargetPlatformIdentifier)'==''" Include="VerifyXunit" />

<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
Expand All @@ -59,7 +60,7 @@

<!-- only non-platform-specific projects should include these packages -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)'==''">
<PackageReference Include="Verify.Xunit" Version="30.3.1" />
<PackageReference Include="Verify.Xunit" Version="30.5.0" />
<PackageReference Include="Verify.DiffPlex" Version="3.1.2" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
FileName: Internals/SimpleStackTraceFactoryTests.cs,
Function: void SimpleStackTraceFactoryTests.GenericMethodThatThrows<T>(T value),
AbsolutePath: {ProjectDirectory}Internals/SimpleStackTraceFactoryTests.cs,
InApp: true,
AddressMode: rel:0
FileName: {ProjectDirectory}Internals/SimpleStackTraceFactoryTests.cs,
Function: Tests.Internals.SimpleStackTraceFactoryTests.GenericMethodThatThrows[T](T value),
Module: Other
}
25 changes: 10 additions & 15 deletions test/Sentry.Tests/Internals/SimpleStackTraceFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,22 @@
// Stack trace filters out Sentry frames by namespace
namespace Other.Tests.Internals;

// TODO: Create integration test to test this behaviour when publishing AOT apps
// See https://github.com/getsentry/sentry-dotnet/pull/2732#discussion_r1371006441
#if PLATFORM_NEUTRAL

public class SimpleStackTraceFactoryTests
{
private class Fixture
{
public SentryOptions SentryOptions { get; } = new();
public SentryStackTraceFactory GetSut() => new(SentryOptions);
}

private readonly Fixture _fixture = new();

[Fact]
public Task MethodGeneric()
{
_fixture.SentryOptions.UseStackTraceFactory(new SimpleStackTraceFactory(_fixture.SentryOptions));

// Arrange
var i = 5;
const int i = 5;
var exception = Record.Exception(() => GenericMethodThatThrows(i));

_fixture.SentryOptions.AttachStacktrace = true;
var factory = _fixture.GetSut();
var options = new SentryOptions
{
AttachStacktrace = true
};
var factory = new SimpleStackTraceFactory(options);

// Act
var stackTrace = factory.Create(exception);
Expand All @@ -45,3 +38,5 @@ public Task MethodGeneric()
private static void GenericMethodThatThrows<T>(T value) =>
throw new Exception();
}

#endif
Loading