Skip to content

Commit

Permalink
Merge pull request #9 from kvpt/dev
Browse files Browse the repository at this point in the history
Fix issue #8
  • Loading branch information
nblumhardt authored Aug 11, 2016
2 parents 694658e + 4301d11 commit ea1e8f8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Serilog.Enrichers.Environment/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"net4.5": {
"define": ["ENV_USER_NAME"]
},
"netstandard1.5": {
"netstandard1.3": {
"dependencies": {
"System.Runtime.Extensions": "4.1.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Serilog.Events;
using Serilog.Tests.Support;
using Xunit;

namespace Serilog.Tests.Enrichers
{
public class EnvironmentMachineNameEnricherTests
{
[Fact]
public void EnvironmentMachineNameEnricherIsApplied()
{
LogEvent evt = null;
var log = new LoggerConfiguration()
.Enrich.WithMachineName()
.WriteTo.Sink(new DelegatingSink(e => evt = e))
.CreateLogger();

log.Information(@"Has an MachineName property");

Assert.NotNull(evt);
Assert.NotEmpty((string)evt.Properties["MachineName"].LiteralValue());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if PROCESS

using Serilog.Events;
using Serilog.Events;
using Serilog.Tests.Support;
using Xunit;

Expand All @@ -24,4 +22,3 @@ public void EnvironmentUserNameEnricherIsApplied()
}
}
}
#endif
6 changes: 3 additions & 3 deletions test/Serilog.Enrichers.Environment.Tests/project.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
{
"testRunner": "xunit",
"dependencies": {
"dependencies": {
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-build10015",
"dotnet-test-xunit": "1.0.0-*",
"Serilog.Enrichers.Environment": {
"target": "project"
}
Expand Down

0 comments on commit ea1e8f8

Please sign in to comment.