Skip to content

Commit

Permalink
Adding tests for LogManagerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Sep 7, 2012
1 parent dd49a74 commit 276db07
Show file tree
Hide file tree
Showing 7 changed files with 770 additions and 0 deletions.
2 changes: 2 additions & 0 deletions MetroLog.NetFx/Properties/AssemblyInfo.cs
@@ -1,6 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
Expand All @@ -16,3 +17,4 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("062692e3-ba44-4e7c-8795-e41f77518691")]

[assembly: SecurityTransparent]
Binary file added MetroLog.Tests/Fakes/MetroLog.fakes
Binary file not shown.
Binary file added MetroLog.Tests/FakesAssemblies/MetroLog.Fakes.dll
Binary file not shown.
Binary file not shown.
734 changes: 734 additions & 0 deletions MetroLog.Tests/FakesAssemblies/MetroLog.Fakes.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions MetroLog.Tests/MetroLog.Tests.csproj
Expand Up @@ -81,6 +81,10 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="MetroLog.Fakes">
<HintPath>FakesAssemblies\MetroLog.Fakes.dll</HintPath>
</Reference>
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -98,13 +102,15 @@
<Compile Include="Tests\BrokenTargetTests.cs" />
<Compile Include="Tests\LevelTests.cs" />
<Compile Include="Tests\LoggerTests.cs" />
<Compile Include="Tests\LogManagerFactoryTests.cs" />
<Compile Include="Tests\LogManagerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\MetroLog.snk">
<Link>MetroLog.snk</Link>
</None>
<Fakes Include="Fakes\MetroLog.fakes" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
28 changes: 28 additions & 0 deletions MetroLog.Tests/Tests/LogManagerFactoryTests.cs
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MetroLog.Fakes;
using Microsoft.QualityTools.Testing.Fakes;
using Xunit;

namespace MetroLog.Tests.Tests
{
public class LogManagerFactoryTests
{
[Fact]
public void InitalizeCallsSetDefault()
{
bool wasCalled = false;
// using (ShimsContext.Create())
//{
// ShimLogManagerFactoryBase.SetDefaultLogManagerILogManager = lm => wasCalled = true;

//LogManagerFactory.Initialize();
//}

Assert.True(wasCalled);
}
}
}

0 comments on commit 276db07

Please sign in to comment.