Skip to content

Commit 6a5658c

Browse files
committed
Prevent inlining to make the tests pass in Releaseconfig and also ensure consistency.
1 parent 0a33cc5 commit 6a5658c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CorrelatorSharp.Logging.Tests/LogManagerSpecs.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Runtime.CompilerServices;
45
using System.Text;
56
using System.Threading.Tasks;
67
using Machine.Specifications;
@@ -18,9 +19,15 @@ public class When_creating_a_logger_for_the_current_class
1819
};
1920

2021
Because of = () => {
21-
Logger = TestClass.CreateCurrentClassLogger();
22+
Logger = CreateLogger();
2223
};
2324

25+
[MethodImpl(MethodImplOptions.NoInlining)]
26+
private static ILogger CreateLogger()
27+
{
28+
return TestClass.CreateCurrentClassLogger();
29+
}
30+
2431

2532
It should_name_the_logger_with_the_class_name = () => {
2633
Logger.Name.ShouldEqual(typeof(TestClass).FullName);
@@ -31,6 +38,7 @@ public class When_creating_a_logger_for_the_current_class
3138

3239
internal class TestClass
3340
{
41+
[MethodImpl(MethodImplOptions.NoInlining)]
3442
public ILogger CreateCurrentClassLogger()
3543
{
3644
return LogManager.GetCurrentClassLogger();

0 commit comments

Comments
 (0)