Skip to content

Commit 4342519

Browse files
authored
fix indent issue from file scoped namespace change (#1370)
1 parent 893163d commit 4342519

File tree

7 files changed

+95
-97
lines changed

7 files changed

+95
-97
lines changed

test/Sentry.Extensions.Logging.Tests/MelDiagnosticLoggerTests.cs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#if NETCOREAPP2_1 || NET461
2-
#endif
31
using Microsoft.Extensions.Logging;
42

53
namespace Sentry.Extensions.Logging.Tests;
@@ -43,25 +41,25 @@ public void LogLevel_HigherLevel_IsEnabled()
4341
// .NET Core 3 (and hence .NET 5) has turned FormattedLogValues into an internal readonly struct
4442
// and now we can't match that with NSubstitute
4543
#if NETCOREAPP2_1 || NET461
46-
[Fact]
47-
public void Log_PassedThrough()
48-
{
49-
const SentryLevel expectedLevel = SentryLevel.Debug;
50-
const string expectedMessage = "test";
51-
var expectedException = new Exception();
44+
[Fact]
45+
public void Log_PassedThrough()
46+
{
47+
const SentryLevel expectedLevel = SentryLevel.Debug;
48+
const string expectedMessage = "test";
49+
var expectedException = new Exception();
5250

53-
_fixture.Level = SentryLevel.Debug;
54-
var sut = _fixture.GetSut();
55-
_ = _fixture.MelLogger.IsEnabled(Arg.Any<LogLevel>()).Returns(true);
51+
_fixture.Level = SentryLevel.Debug;
52+
var sut = _fixture.GetSut();
53+
_ = _fixture.MelLogger.IsEnabled(Arg.Any<LogLevel>()).Returns(true);
5654

57-
sut.Log(expectedLevel, expectedMessage, expectedException);
55+
sut.Log(expectedLevel, expectedMessage, expectedException);
5856

59-
_fixture.MelLogger.Received(1).Log(
60-
expectedLevel.ToMicrosoft(),
61-
0,
62-
Arg.Is<object>(e => e.ToString() == expectedMessage),
63-
expectedException,
64-
Arg.Any<Func<object, Exception, string>>());
65-
}
57+
_fixture.MelLogger.Received(1).Log(
58+
expectedLevel.ToMicrosoft(),
59+
0,
60+
Arg.Is<object>(e => e.ToString() == expectedMessage),
61+
expectedException,
62+
Arg.Any<Func<object, Exception, string>>());
63+
}
6664
#endif
6765
}

test/Sentry.Tests/Internals/Http/HttpTransportTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public async Task SendEnvelopeAsync_CancellationToken_PassedToClient()
3232
#if NET5_0_OR_GREATER
3333
await Assert.ThrowsAsync<TaskCanceledException>(() => httpTransport.SendEnvelopeAsync(envelope, token));
3434
#else
35-
// Act
36-
await httpTransport.SendEnvelopeAsync(envelope, token);
35+
// Act
36+
await httpTransport.SendEnvelopeAsync(envelope, token);
3737

38-
// Assert
39-
await httpHandler
40-
.Received(1)
41-
.VerifiableSendAsync(Arg.Any<HttpRequestMessage>(), Arg.Is<CancellationToken>(c => c.IsCancellationRequested));
38+
// Assert
39+
await httpHandler
40+
.Received(1)
41+
.VerifiableSendAsync(Arg.Any<HttpRequestMessage>(), Arg.Is<CancellationToken>(c => c.IsCancellationRequested));
4242
#endif
4343
}
4444

test/Sentry.Tests/Internals/JsonTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ public void WriteDynamicValue_ClassWithTimeZone_SerializedClassWithTimeZoneInfo(
202202
#if NET6_0
203203
"\"BaseUtcOffset\":\"02:00:00\"",
204204
#else
205-
"\"BaseUtcOffset\":{\"Ticks\":72000000000,\"Days\":0,\"Hours\":2,\"Milliseconds\":0,\"Minutes\":0,\"Seconds\":0",
206-
"\"TotalHours\":2,\"TotalMilliseconds\":7200000,\"TotalMinutes\":120,\"TotalSeconds\":7200},",
205+
"\"BaseUtcOffset\":{\"Ticks\":72000000000,\"Days\":0,\"Hours\":2,\"Milliseconds\":0,\"Minutes\":0,\"Seconds\":0",
206+
"\"TotalHours\":2,\"TotalMilliseconds\":7200000,\"TotalMinutes\":120,\"TotalSeconds\":7200},",
207207
#endif
208208
};
209209
var data = new DataWithSerializableObject<TimeZoneInfo>(timeZone);

test/Sentry.Tests/PlatformAbstractions/RuntimeInfoTests.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,31 +41,31 @@ public void Parse_TestCases(ParseTestCase parseTestCase)
4141
}
4242

4343
#if NET461
44-
[SkippableFact]
45-
public void SetReleaseAndVersionNetFx_OnNetFx_NonNullReleaseAndVersion()
46-
{
47-
// This test is only relevant when running on CLR.
48-
Skip.If(RuntimeInfo.GetRuntime().IsMono());
44+
[SkippableFact]
45+
public void SetReleaseAndVersionNetFx_OnNetFx_NonNullReleaseAndVersion()
46+
{
47+
// This test is only relevant when running on CLR.
48+
Skip.If(RuntimeInfo.GetRuntime().IsMono());
4949

50-
var input = new Runtime(".NET Framework");
51-
RuntimeInfo.SetNetFxReleaseAndVersion(input);
50+
var input = new Runtime(".NET Framework");
51+
RuntimeInfo.SetNetFxReleaseAndVersion(input);
5252

53-
Assert.NotNull(input.Version);
54-
Assert.NotNull(input.FrameworkInstallation);
55-
Assert.NotNull(input.FrameworkInstallation.Version);
56-
}
53+
Assert.NotNull(input.Version);
54+
Assert.NotNull(input.FrameworkInstallation);
55+
Assert.NotNull(input.FrameworkInstallation.Version);
56+
}
5757
#endif
5858

5959
#if NETCOREAPP2_1 || NETCOREAPP3_0
60-
[Fact]
61-
public void SetNetCoreVersion_NetCoreAsName()
62-
{
63-
var input = new Runtime(".NET Core");
64-
RuntimeInfo.SetNetCoreVersion(input);
60+
[Fact]
61+
public void SetNetCoreVersion_NetCoreAsName()
62+
{
63+
var input = new Runtime(".NET Core");
64+
RuntimeInfo.SetNetCoreVersion(input);
6565

66-
Assert.NotNull(input.Version);
67-
Assert.Equal(".NET Core", input.Name);
68-
}
66+
Assert.NotNull(input.Version);
67+
Assert.Equal(".NET Core", input.Name);
68+
}
6969
#endif
7070

7171
#if NET5_0_OR_GREATER

test/Sentry.Tests/SentryOptionsExtensionsTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public void DisableDuplicateEventDetection_RemovesDisableDuplicateEventDetection
1717
}
1818

1919
#if NET461
20-
[Fact]
21-
public void DisableNetFxInstallationsEventProcessor_RemovesDisableNetFxInstallationsEventProcessorEventProcessor()
22-
{
23-
Sut.DisableNetFxInstallationsIntegration();
24-
Assert.DoesNotContain(Sut.EventProcessors,
25-
p => p.GetType() == typeof(NetFxInstallationsEventProcessor));
26-
Assert.DoesNotContain(Sut.Integrations,
27-
p => p.GetType() == typeof(NetFxInstallationsIntegration));
28-
}
20+
[Fact]
21+
public void DisableNetFxInstallationsEventProcessor_RemovesDisableNetFxInstallationsEventProcessorEventProcessor()
22+
{
23+
Sut.DisableNetFxInstallationsIntegration();
24+
Assert.DoesNotContain(Sut.EventProcessors,
25+
p => p.GetType() == typeof(NetFxInstallationsEventProcessor));
26+
Assert.DoesNotContain(Sut.Integrations,
27+
p => p.GetType() == typeof(NetFxInstallationsIntegration));
28+
}
2929
#endif
3030

3131
[Fact]

test/Sentry.Tests/SentryOptionsTests.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ public void RequestBodyCompressionLevel_ByDefault_Optimal()
2424
}
2525

2626
#if NET461
27-
[SkippableFact(typeof(IsTypeException))]
28-
public void StackTraceFactory_RunningOnMono_HasMonoStackTraceFactory()
29-
{
30-
Skip.If(!RuntimeInfo.GetRuntime().IsMono());
27+
[SkippableFact(typeof(IsTypeException))]
28+
public void StackTraceFactory_RunningOnMono_HasMonoStackTraceFactory()
29+
{
30+
Skip.If(!RuntimeInfo.GetRuntime().IsMono());
3131

32-
var sut = new SentryOptions();
33-
Assert.IsType<MonoSentryStackTraceFactory>(sut.SentryStackTraceFactory);
34-
}
32+
var sut = new SentryOptions();
33+
Assert.IsType<MonoSentryStackTraceFactory>(sut.SentryStackTraceFactory);
34+
}
3535

36-
[SkippableFact(typeof(IsNotTypeException))]
37-
public void StackTraceFactory_NotRunningOnMono_NotMonoStackTraceFactory()
38-
{
39-
Skip.If(RuntimeInfo.GetRuntime().IsMono());
36+
[SkippableFact(typeof(IsNotTypeException))]
37+
public void StackTraceFactory_NotRunningOnMono_NotMonoStackTraceFactory()
38+
{
39+
Skip.If(RuntimeInfo.GetRuntime().IsMono());
4040

41-
var sut = new SentryOptions();
42-
Assert.IsNotType<MonoSentryStackTraceFactory>(sut.SentryStackTraceFactory);
43-
}
41+
var sut = new SentryOptions();
42+
Assert.IsNotType<MonoSentryStackTraceFactory>(sut.SentryStackTraceFactory);
43+
}
4444
#endif
4545
}

test/Sentry.Tests/TaskUnobservedTaskExceptionIntegrationTests.cs

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,38 @@ public void Handle_WithException_CaptureEvent()
2929

3030
// Only triggers in release mode.
3131
#if RELEASE
32-
[Fact] // Integration test.
33-
public void Handle_UnobservedTaskException_CaptureEvent()
32+
[Fact] // Integration test.
33+
public void Handle_UnobservedTaskException_CaptureEvent()
34+
{
35+
_fixture.AppDomain = AppDomainAdapter.Instance;
36+
var captureCalledEvent = new System.Threading.ManualResetEvent(false);
37+
_fixture.Hub.When(x => x.CaptureEvent(Arg.Any<SentryEvent>()))
38+
.Do(_ => captureCalledEvent.Set());
39+
40+
var sut = _fixture.GetSut();
41+
sut.Register(_fixture.Hub, SentryOptions);
42+
try
3443
{
35-
_fixture.AppDomain = AppDomainAdapter.Instance;
36-
var captureCalledEvent = new System.Threading.ManualResetEvent(false);
37-
_fixture.Hub.When(x => x.CaptureEvent(Arg.Any<SentryEvent>()))
38-
.Do(_ => captureCalledEvent.Set());
39-
40-
var sut = _fixture.GetSut();
41-
sut.Register(_fixture.Hub, SentryOptions);
42-
try
44+
var taskStartedEvent = new System.Threading.ManualResetEvent(false);
45+
_ = Task.Run(() =>
4346
{
44-
var taskStartedEvent = new System.Threading.ManualResetEvent(false);
45-
_ = Task.Run(() =>
46-
{
47-
_ = taskStartedEvent.Set();
48-
throw new Exception("Unhandled on Task");
49-
});
50-
Assert.True(taskStartedEvent.WaitOne(TimeSpan.FromSeconds(4)));
51-
var counter = 0;
52-
do
53-
{
54-
Assert.True(counter++ < 10);
55-
GC.Collect();
56-
GC.WaitForPendingFinalizers();
57-
} while (!captureCalledEvent.WaitOne(TimeSpan.FromMilliseconds(100)));
58-
}
59-
finally
47+
_ = taskStartedEvent.Set();
48+
throw new Exception("Unhandled on Task");
49+
});
50+
Assert.True(taskStartedEvent.WaitOne(TimeSpan.FromSeconds(4)));
51+
var counter = 0;
52+
do
6053
{
61-
sut.Unregister(_fixture.Hub);
62-
}
54+
Assert.True(counter++ < 10);
55+
GC.Collect();
56+
GC.WaitForPendingFinalizers();
57+
} while (!captureCalledEvent.WaitOne(TimeSpan.FromMilliseconds(100)));
6358
}
59+
finally
60+
{
61+
sut.Unregister(_fixture.Hub);
62+
}
63+
}
6464
#endif
6565

6666
[Fact]

0 commit comments

Comments
 (0)