Skip to content

Commit

Permalink
Enable AspNetCore6 browser injection for razor test (#2053)
Browse files Browse the repository at this point in the history
  • Loading branch information
nr-ahemsath committed Nov 10, 2023
1 parent 9612e37 commit d0b8d26
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -13,12 +13,12 @@
namespace NewRelic.Agent.IntegrationTests.BasicInstrumentation
{
[NetCoreTest]
public class BasicAspNetCoreRazorApplication : NewRelicIntegrationTest<RemoteServiceFixtures.BasicAspNetCoreRazorApplicationFixture>
public class BasicAspNetCoreRazorTests : NewRelicIntegrationTest<RemoteServiceFixtures.BasicAspNetCoreRazorApplicationFixture>
{
private readonly RemoteServiceFixtures.BasicAspNetCoreRazorApplicationFixture _fixture;
private string _responseBody;

public BasicAspNetCoreRazorApplication(RemoteServiceFixtures.BasicAspNetCoreRazorApplicationFixture fixture, ITestOutputHelper output)
public BasicAspNetCoreRazorTests(RemoteServiceFixtures.BasicAspNetCoreRazorApplicationFixture fixture, ITestOutputHelper output)
: base(fixture)
{
_fixture = fixture;
Expand All @@ -31,6 +31,7 @@ public BasicAspNetCoreRazorApplication(RemoteServiceFixtures.BasicAspNetCoreRazo
var configModifier = new NewRelicConfigModifier(configPath);
configModifier.ForceTransactionTraces();
configModifier.SetCodeLevelMetricsEnabled();
configModifier.EnableAspNetCore6PlusBrowserInjection(true);
},
exerciseApplication: () =>
{
Expand Down Expand Up @@ -60,8 +61,8 @@ public void Test()
new Assertions.ExpectedMetric { metricName = @"OtherTransaction/Normalized/*" },
new Assertions.ExpectedMetric { metricName = @"OtherTransaction/all" },

// The .NET agent does not have the information needed to generate this metric
new Assertions.ExpectedMetric { metricName = @"CPU/WebTransaction", callCount = 1 },
// The .NET agent does not have the information needed to generate this metric
new Assertions.ExpectedMetric { metricName = @"CPU/WebTransaction", callCount = 1 },
new Assertions.ExpectedMetric { metricName = @"CPU/WebTransaction/Razor/Pages/Index", callCount = 1 },
};

Expand Down

0 comments on commit d0b8d26

Please sign in to comment.