Merge branch 'master' into VisitorPatternRevisit
This commit is contained in:
Коммит
89b4aa6b70
|
@ -1,13 +1,19 @@
|
|||
# Ensure eol normalization
|
||||
* text=auto
|
||||
|
||||
# These files are text and should be normalized (convert crlf => lf)
|
||||
*.cs text diff=csharp
|
||||
*.xaml text
|
||||
*.config text
|
||||
*.csproj text
|
||||
*.sln text
|
||||
*.tt text
|
||||
*.ps1 text
|
||||
*.cmd text
|
||||
*.bat text
|
||||
*.msbuild text
|
||||
*.md text
|
||||
*.targets text
|
||||
|
||||
# Images should be treated as binary
|
||||
# (binary is a macro for -text -diff)
|
||||
|
|
|
@ -35,20 +35,20 @@
|
|||
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Shouldly, Version=2.8.2.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Shouldly.2.8.2\lib\net40\Shouldly.dll</HintPath>
|
||||
<Reference Include="Shouldly, Version=2.8.3.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Shouldly.2.8.3\lib\net40\Shouldly.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
|
||||
<Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Reflection.Metadata, Version=1.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
|
||||
<Reference Include="System.Reflection.Metadata, Version=1.4.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\System.Reflection.Metadata.1.5.0\lib\portable-net45+win8\System.Reflection.Metadata.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.4.1.0" newVersion="1.4.1.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
<package id="Microsoft.CodeAnalysis.Common" version="1.3.2" targetFramework="net45" />
|
||||
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.2" targetFramework="net45" />
|
||||
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net45" />
|
||||
<package id="Shouldly" version="2.8.2" targetFramework="net45" />
|
||||
<package id="NUnit" version="3.8.1" targetFramework="net45" />
|
||||
<package id="Shouldly" version="2.8.3" targetFramework="net45" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net45" />
|
||||
<package id="System.Collections.Immutable" version="1.4.0" targetFramework="net45" />
|
||||
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Globalization" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Linq" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Reflection.Metadata" version="1.4.2" targetFramework="net45" />
|
||||
<package id="System.Reflection.Metadata" version="1.5.0" targetFramework="net45" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net45" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net45" />
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace NSubstitute.Weaver
|
|||
readonly TypeReference m_ObjectType;
|
||||
readonly MethodReference m_GetTypeFromHandleMethod;
|
||||
readonly TypeReference m_TypeType;
|
||||
readonly TypeDefinition m_MulticastDelegate;
|
||||
|
||||
public MockInjectorVisitor(AssemblyDefinition fakeFramework, ModuleDefinition module)
|
||||
{
|
||||
|
@ -29,6 +30,7 @@ namespace NSubstitute.Weaver
|
|||
|
||||
m_ObjectType = new TypeReference("System", "Object", module, msCorlibReference);
|
||||
m_TypeType = new TypeReference("System", "Type", module, msCorlibReference);
|
||||
m_MulticastDelegate = new TypeReference("System", "MulticastDelegate", module, msCorlibReference).Resolve();
|
||||
|
||||
var resolvedSystemType = m_TypeType.Resolve();
|
||||
m_GetTypeFromHandleMethod = module.Import(resolvedSystemType.Methods.Single(m => m.Name == "GetTypeFromHandle" && m.HasParameters && m.Parameters.Count == 1 && m.Parameters[0].ParameterType.FullName == "System.RuntimeTypeHandle"));
|
||||
|
@ -44,7 +46,7 @@ namespace NSubstitute.Weaver
|
|||
|| ca.AttributeType.Name == "TestFixtureAttribute"))
|
||||
return;
|
||||
|
||||
if (typeDefinition.BaseType != null && typeDefinition.BaseType.FullName == typeDefinition.Module.Import(typeof(MulticastDelegate)).FullName)
|
||||
if (typeDefinition.BaseType != null && typeDefinition.BaseType.Resolve() == m_MulticastDelegate)
|
||||
return;
|
||||
|
||||
if (typeDefinition.IsInterface)
|
||||
|
|
|
@ -12,9 +12,7 @@ namespace NSubstitute.Weaver
|
|||
{
|
||||
using (var sourceAssemblyFile = File.OpenRead(assemblyToPatchPath))
|
||||
{
|
||||
var outputAssemblyPath = Path.Combine(Path.Combine(Path.GetDirectoryName(assemblyToPatchPath), "Patched"), Path.GetFileName(assemblyToPatchPath));
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputAssemblyPath));
|
||||
|
||||
var outputAssemblyPath = Path.GetFileName(assemblyToPatchPath) + ".patched";
|
||||
InjectFakes(sourceAssemblyFile, outputAssemblyPath, nsubstituteAssemblyPath, Path.GetDirectoryName(assemblyToPatchPath));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net35\Mono.Cecil.Rocks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\NUnit.3.6.1\lib\net35\nunit.framework.dll</HintPath>
|
||||
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\NUnit.3.8.1\lib\net35\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net35" />
|
||||
<package id="NUnit" version="3.6.1" targetFramework="net35" />
|
||||
<package id="NUnit" version="3.8.1" targetFramework="net35" />
|
||||
</packages>
|
Загрузка…
Ссылка в новой задаче