-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ba244f
commit b8829d0
Showing
15 changed files
with
3,164 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.verified.txt text eol=lf | ||
*.verified.xml text eol=lf | ||
*.verified.json text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ Thumbs.db | |
*.log | ||
*.binlog | ||
*.orig | ||
|
||
*.received.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using DiffEngine; | ||
using NUnit.Framework; | ||
using VerifyTests; | ||
|
||
namespace ZeroLog.Tests.NetStandard; | ||
|
||
[SetUpFixture] | ||
public static class Initializer | ||
{ | ||
[OneTimeSetUp] | ||
public static void Initialize() | ||
{ | ||
DiffRunner.Disabled = true; | ||
VerifyDiffPlex.Initialize(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
using PublicApiGenerator; | ||
using VerifyNUnit; | ||
|
||
namespace ZeroLog.Tests.NetStandard; | ||
|
||
[TestFixture] | ||
public class SanityChecks | ||
{ | ||
[Test] | ||
public Task should_export_expected_namespaces() | ||
{ | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.ExportedTypes | ||
.Select(i => i.Namespace) | ||
.OrderBy(i => i) | ||
.Distinct() | ||
); | ||
} | ||
|
||
[Test] | ||
public Task should_export_expected_types() | ||
{ | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.ExportedTypes | ||
.Select(i => i.FullName) | ||
.OrderBy(i => i) | ||
.Distinct() | ||
); | ||
} | ||
|
||
[Test] | ||
public Task should_have_expected_public_api() | ||
{ | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.GeneratePublicApi(new ApiGeneratorOptions | ||
{ | ||
IncludeAssemblyAttributes = false, | ||
ExcludeAttributes = new[] | ||
{ | ||
typeof(ObsoleteAttribute).FullName | ||
} | ||
}) | ||
); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/ZeroLog.Tests.NetStandard/SanityChecks.should_export_expected_namespaces.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
ZeroLog | ||
] |
14 changes: 14 additions & 0 deletions
14
src/ZeroLog.Tests.NetStandard/SanityChecks.should_export_expected_types.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
ZeroLog.Log, | ||
ZeroLog.Log+DebugInterpolatedStringHandler, | ||
ZeroLog.Log+ErrorInterpolatedStringHandler, | ||
ZeroLog.Log+FatalInterpolatedStringHandler, | ||
ZeroLog.Log+InfoInterpolatedStringHandler, | ||
ZeroLog.Log+TraceInterpolatedStringHandler, | ||
ZeroLog.Log+WarnInterpolatedStringHandler, | ||
ZeroLog.LogLevel, | ||
ZeroLog.LogManager, | ||
ZeroLog.LogMessage, | ||
ZeroLog.LogMessage+AppendInterpolatedStringHandler, | ||
ZeroLog.LogMessage+AppendOperation`1 | ||
] |
807 changes: 807 additions & 0 deletions
807
src/ZeroLog.Tests.NetStandard/SanityChecks.should_have_expected_public_api.verified.txt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Runtime.CompilerServices; | ||
using DiffEngine; | ||
using VerifyTests; | ||
|
||
namespace ZeroLog.Tests; | ||
|
||
#pragma warning disable CA2255 | ||
|
||
public static class ModuleInitializer | ||
{ | ||
[ModuleInitializer] | ||
public static void Initialize() | ||
{ | ||
DiffRunner.Disabled = true; | ||
VerifyDiffPlex.Initialize(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
using ZeroLog.Tests.Support; | ||
using PublicApiGenerator; | ||
using VerifyNUnit; | ||
|
||
namespace ZeroLog.Tests; | ||
|
||
[TestFixture] | ||
public class SanityChecks | ||
{ | ||
[Test] | ||
public void should_export_expected_types() | ||
public Task should_export_expected_namespaces() | ||
{ | ||
// This test prevents mistakenly adding public types in the future. | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.ExportedTypes | ||
.Select(i => i.Namespace) | ||
.OrderBy(i => i) | ||
.Distinct() | ||
); | ||
} | ||
|
||
var publicTypes = new[] | ||
{ | ||
"ZeroLog.Appenders.Appender", | ||
"ZeroLog.Appenders.ConsoleAppender", | ||
"ZeroLog.Appenders.DateAndSizeRollingFileAppender", | ||
"ZeroLog.Appenders.NoopAppender", | ||
"ZeroLog.Appenders.StreamAppender", | ||
"ZeroLog.Appenders.TextWriterAppender", | ||
"ZeroLog.Configuration.AppenderConfiguration", | ||
"ZeroLog.Configuration.AppendingStrategy", | ||
"ZeroLog.Configuration.ILoggerConfigurationCollection", | ||
"ZeroLog.Configuration.LogMessagePoolExhaustionStrategy", | ||
"ZeroLog.Configuration.LoggerConfiguration", | ||
"ZeroLog.Configuration.RootLoggerConfiguration", | ||
"ZeroLog.Configuration.ZeroLogConfiguration", | ||
"ZeroLog.Formatting.DefaultFormatter", | ||
"ZeroLog.Formatting.Formatter", | ||
"ZeroLog.Formatting.KeyValueList", | ||
"ZeroLog.Formatting.KeyValueList+Enumerator", | ||
"ZeroLog.Formatting.LoggedKeyValue", | ||
"ZeroLog.Formatting.LoggedMessage", | ||
"ZeroLog.Log", | ||
"ZeroLog.Log+DebugInterpolatedStringHandler", | ||
"ZeroLog.Log+ErrorInterpolatedStringHandler", | ||
"ZeroLog.Log+FatalInterpolatedStringHandler", | ||
"ZeroLog.Log+InfoInterpolatedStringHandler", | ||
"ZeroLog.Log+TraceInterpolatedStringHandler", | ||
"ZeroLog.Log+WarnInterpolatedStringHandler", | ||
"ZeroLog.LogLevel", | ||
"ZeroLog.LogManager", | ||
"ZeroLog.LogMessage", | ||
"ZeroLog.LogMessage+AppendInterpolatedStringHandler", | ||
"ZeroLog.LogMessage+AppendOperation`1", | ||
"ZeroLog.UnmanagedFormatterDelegate`1", | ||
}; | ||
[Test] | ||
public Task should_export_expected_types() | ||
{ | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.ExportedTypes | ||
.Select(i => i.FullName) | ||
.OrderBy(i => i) | ||
.Distinct() | ||
); | ||
} | ||
|
||
typeof(LogManager).Assembly | ||
.ExportedTypes | ||
.Select(i => i.FullName) | ||
.ShouldBeEquivalentTo(publicTypes); | ||
[Test] | ||
public Task should_have_expected_public_api() | ||
{ | ||
return Verifier.Verify( | ||
typeof(LogManager).Assembly | ||
.GeneratePublicApi(new ApiGeneratorOptions | ||
{ | ||
IncludeAssemblyAttributes = false, | ||
ExcludeAttributes = new[] | ||
{ | ||
typeof(ObsoleteAttribute).FullName, | ||
#if NET7_0_OR_GREATER | ||
typeof(CompilerFeatureRequiredAttribute).FullName | ||
#endif | ||
} | ||
}) | ||
).UniqueForTargetFrameworkAndVersion(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/ZeroLog.Tests/SanityChecks.should_export_expected_namespaces.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
ZeroLog, | ||
ZeroLog.Appenders, | ||
ZeroLog.Configuration, | ||
ZeroLog.Formatting | ||
] |
34 changes: 34 additions & 0 deletions
34
src/ZeroLog.Tests/SanityChecks.should_export_expected_types.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[ | ||
ZeroLog.Appenders.Appender, | ||
ZeroLog.Appenders.ConsoleAppender, | ||
ZeroLog.Appenders.DateAndSizeRollingFileAppender, | ||
ZeroLog.Appenders.NoopAppender, | ||
ZeroLog.Appenders.StreamAppender, | ||
ZeroLog.Appenders.TextWriterAppender, | ||
ZeroLog.Configuration.AppenderConfiguration, | ||
ZeroLog.Configuration.AppendingStrategy, | ||
ZeroLog.Configuration.ILoggerConfigurationCollection, | ||
ZeroLog.Configuration.LoggerConfiguration, | ||
ZeroLog.Configuration.LogMessagePoolExhaustionStrategy, | ||
ZeroLog.Configuration.RootLoggerConfiguration, | ||
ZeroLog.Configuration.ZeroLogConfiguration, | ||
ZeroLog.Formatting.DefaultFormatter, | ||
ZeroLog.Formatting.Formatter, | ||
ZeroLog.Formatting.KeyValueList, | ||
ZeroLog.Formatting.KeyValueList+Enumerator, | ||
ZeroLog.Formatting.LoggedKeyValue, | ||
ZeroLog.Formatting.LoggedMessage, | ||
ZeroLog.Log, | ||
ZeroLog.Log+DebugInterpolatedStringHandler, | ||
ZeroLog.Log+ErrorInterpolatedStringHandler, | ||
ZeroLog.Log+FatalInterpolatedStringHandler, | ||
ZeroLog.Log+InfoInterpolatedStringHandler, | ||
ZeroLog.Log+TraceInterpolatedStringHandler, | ||
ZeroLog.Log+WarnInterpolatedStringHandler, | ||
ZeroLog.LogLevel, | ||
ZeroLog.LogManager, | ||
ZeroLog.LogMessage, | ||
ZeroLog.LogMessage+AppendInterpolatedStringHandler, | ||
ZeroLog.LogMessage+AppendOperation`1, | ||
ZeroLog.UnmanagedFormatterDelegate`1 | ||
] |
Oops, something went wrong.