Skip to content

Commit

Permalink
Updated tests for new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Sep 28, 2023
1 parent 5a65707 commit 4b39688
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/Sentry/Internal/SettingLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ public string GetDsn()
?? AssemblyForAttributes?.GetCustomAttribute<DsnAttribute>()?.Dsn;
if (_options.Dsn is null)
{
throw new ArgumentNullException(
"You must supply a DSN to use Sentry." +
"To disable Sentry, pass an empty string: \"\"." +
"See https://docs.sentry.io/platforms/dotnet/configuration/options/#dsn"
);
throw new ArgumentNullException("You must supply a DSN to use Sentry." +
"To disable Sentry, pass an empty string: \"\"." +
"See https://docs.sentry.io/platforms/dotnet/configuration/options/#dsn");
}
return _options.Dsn;
}
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.NLog.Tests/SentryTargetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public void InitializeTarget_InitializesSdk()
_fixture.GetLoggerFactory();

var logOutput = logWriter.ToString();
Assert.Contains("Init called with Disabled DSN. Sentry SDK will be disabled.", logOutput);
Assert.Contains("Init called with an empty string as the DSN. Sentry SDK will be disabled.", logOutput);
}
finally
{
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/SentrySdkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void Init_EmptyDsn_LogsWarning()

using (SentrySdk.Init(options))
{
_logger.Received(1).Log(SentryLevel.Warning, "Init called with Disabled DSN. Sentry SDK will be disabled.");
_logger.Received(1).Log(SentryLevel.Warning, "Init called with an empty string as the DSN. Sentry SDK will be disabled.");
}
}

Expand Down

0 comments on commit 4b39688

Please sign in to comment.