Skip to content

Commit

Permalink
Make namespaces in test projects consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
304NotModified committed Sep 18, 2019
1 parent a22c287 commit bfbc76e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 36 deletions.
2 changes: 2 additions & 0 deletions NLog.Web.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Renderers/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 1 addition & 1 deletion tests/NLog.Web.AspNetCore.Tests/AspNetCoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using NLog.Web.Tests.LayoutRenderers;
using ILoggerFactory = Microsoft.Extensions.Logging.ILoggerFactory;

namespace NLog.Web.AspNetCore.Tests
namespace NLog.Web.Tests
{
public class AspNetCoreTests : TestBase, IDisposable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../NLog.snk</AssemblyOriginatorKeyFile>
<RootNamespace>NLog.Web.Tests</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<DefineConstants>$(DefineConstants);ASP_NET_CORE;ASP_NET_CORE1</DefineConstants>
Expand Down
1 change: 0 additions & 1 deletion tests/NLog.Web.Tests/DefaultHttpContextAccessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Text;
using System.Web;
using NLog.Web.Tests.LayoutRenderers;
using Xunit;

namespace NLog.Web.Tests
Expand Down
4 changes: 0 additions & 4 deletions tests/Shared/FakeHttpContextAccessor.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#if !ASP_NET_CORE
using System.Web;
using System.Collections.Specialized;
using System.Web.SessionState;
#else
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
using HttpContextBase = Microsoft.AspNetCore.Http.HttpContext;
#endif

namespace NLog.Web.Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using NSubstitute;
using Xunit;

namespace NLog.Web.AspNetCore.Tests.LayoutRenderers
namespace NLog.Web.Tests.LayoutRenderers
{
public class AspNetRequestPostedBodyTests : LayoutRenderersTestBase<AspNetRequestPostedBody>
{
Expand Down
36 changes: 17 additions & 19 deletions tests/Shared/LayoutRenderers/AssemblyVersionLayoutRendererTests.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NLog.Layouts;
using Xunit;

namespace NLog.Web.Tests.LayoutRenderers
{
public class AssemblyVersionLayoutRendererTests : TestBase
{
[Fact]
public void AssemblyNameVersionTest()
{
#if ASP_NET_CORE
Layout layout = "${assembly-version:NLog.Web.AspNetCore.Tests}";
private const string AssemblyName = "NLog.Web.AspNetCore.Tests";
#else
Layout layout = "${assembly-version:NLog.Web.Tests}";
private const string AssemblyName = "NLog.Web.Tests";
#endif

[Fact]
public void AssemblyNameVersionTest()
{
Layout layout = "${assembly-version:" + AssemblyName + "}";

var result = layout.Render(LogEventInfo.CreateNullEvent());

Assert.Equal("1.2.3.0", result);
}

[Fact]
public void AssemblyNameFileVersionTest()
{
#if ASP_NET_CORE
Layout layout = "${assembly-version:name=NLog.Web.AspNetCore.Tests:type=file}";
#else
Layout layout = "${assembly-version:NLog.Web.Tests:type=file}";
#endif
Layout layout = "${assembly-version:" + AssemblyName + ":type=file}";

var result = layout.Render(LogEventInfo.CreateNullEvent());

Assert.Equal("1.2.3.1", result);
}

[Fact]
public void AssemblyNameInformationalVersionTest()
{
#if ASP_NET_CORE
Layout layout = "${assembly-version:name=NLog.Web.AspNetCore.Tests:type=informational}";
#else
Layout layout = "${assembly-version:NLog.Web.Tests:type=informational}";
#endif
Layout layout = "${assembly-version:" + AssemblyName + ":type=informational}";

var result = layout.Render(LogEventInfo.CreateNullEvent());

Assert.Equal("1.2.3.2", result);
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Shared/RegisterCustomLayoutRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
using System.Web;
#endif
using NLog.Web.LayoutRenderers;
using NLog.Web.Tests.LayoutRenderers;
using NSubstitute;
using Xunit;

namespace NLog.Web.AspNetCore.Tests
namespace NLog.Web.Tests
{
public class RegisterCustomLayoutRenderer : TestBase
{
Expand Down
9 changes: 1 addition & 8 deletions tests/Shared/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Extensions.Primitives;
#endif

namespace NLog.Web.Tests.LayoutRenderers
namespace NLog.Web.Tests
{
public class TestBase
{
Expand All @@ -19,13 +19,6 @@ public TestBase()
#if ASP_NET_CORE
protected class HeaderDict : Dictionary<string, StringValues>, IHeaderDictionary
{
/// <summary>Initializes a new instance of the <see cref="T:System.Collections.Generic.Dictionary`2" /> class that is empty, has the default initial capacity, and uses the default equality comparer for the key type.</summary>
public HeaderDict()
{
}



#if ASP_NET_CORE2
/// <summary>
/// Strongly typed access to the Content-Length header. Implementations must keep this in sync with the string representation.
Expand Down

0 comments on commit bfbc76e

Please sign in to comment.