public ExpectedErrorTests(RemoteServiceFixtures.AspNetCoreMvcBasicRequestsFixture fixture, ITestOutputHelper output) : base(fixture) { _fixture = fixture; _fixture.TestLogger = output; _fixture.Actions ( setupConfiguration: () => { var configPath = fixture.DestinationNewRelicConfigFilePath; var configModifier = new NewRelicConfigModifier(configPath); configModifier.SetOrDeleteDistributedTraceEnabled(true); configModifier.AddExpectedStatusCodes("410-450") .AddExpectedErrorMessages("System.Exception", new List <string> { "test exception" }) .AddExpectedErrorClasses(new List <string> { "AspNetCoreMvcBasicRequestsApplication.Controllers.CustomExceptionClass" }); }, exerciseApplication: () => { _fixture.ReturnADesiredStatusCode(415); _fixture.ThrowExceptionWithMessage("test exception message"); _fixture.ThrowCustomException(); _fixture.AgentLog.WaitForLogLine(AgentLogBase.ErrorTraceDataLogLineRegex, TimeSpan.FromMinutes(2)); } ); _fixture.Initialize(); }