Commit 4bb21561 authored by Fabien Bondi's avatar Fabien Bondi

Rework Testing to split independent components

parent ff9d0c81
This diff is collapsed.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<Authors>Leoxia</Authors>
<Company>Leoxia Ltd</Company>
<Copyright>Copyright (c) Leoxia Ltd 2011 - 2017. All Rights reserved.</Copyright>
<Version>1.1.90.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Leoxia.Abstractions.IO" Version="1.2.3" />
<PackageReference Include="Leoxia.Implementations" Version="1.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Leoxia.Collections\Leoxia.Collections.csproj" />
<ProjectReference Include="..\Leoxia.Testing.Reflection\Leoxia.Testing.Reflection.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<Authors>Leoxia</Authors>
<Company>Leoxia Ltd</Company>
<Copyright>Copyright (c) Leoxia Ltd 2011 - 2017. All Rights reserved.</Copyright>
<Version>1.1.90.0</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Checkers\**" />
<EmbeddedResource Remove="Checkers\**" />
<None Remove="Checkers\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Leoxia.Abstractions.IO" Version="1.2.3" />
<PackageReference Include="Leoxia.Implementations" Version="1.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Leoxia.Collections\Leoxia.Collections.csproj" />
<ProjectReference Include="..\Leoxia.Testing.Assertions\Leoxia.Testing.Assertions.csproj" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<Authors>Leoxia</Authors>
......
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Leoxia.Testing.Assertions")]
[assembly: InternalsVisibleTo("Leoxia.Testing.Checkers")]
\ No newline at end of file
......@@ -122,7 +122,7 @@ namespace Leoxia.Testing.Reflection
BindingFlags.InvokeMethod);
if (info != null)
{
return (bool) info.Invoke(instance1, new object[] {instance1, instance2});
return (bool)info.Invoke(instance1, new object[] { instance1, instance2 });
}
return false;
}
......@@ -138,7 +138,7 @@ namespace Leoxia.Testing.Reflection
{
var info = typeof(TInstance).GetMethod("op_Inequality",
BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod);
return (bool) info.Invoke(instance1, new object[] {instance1, instance2});
return (bool)info.Invoke(instance1, new object[] { instance1, instance2 });
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<Authors>Leoxia</Authors>
<Company>Leoxia Ltd</Company>
<Copyright>Copyright (c) Leoxia Ltd 2011 - 2017. All Rights reserved.</Copyright>
<Version>1.1.90.0</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Leoxia.Abstractions.IO" Version="1.2.3" />
<PackageReference Include="Leoxia.Implementations" Version="1.2.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Leoxia.Collections\Leoxia.Collections.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -119,7 +119,7 @@ namespace Leoxia.Testing.Reflection
}
}
internal static object CreateInstance(Type type, int seed, bool recurse)
public static object CreateInstance(Type type, int seed, bool recurse)
{
object resultValue;
var flag = CreateValue(type, seed, out resultValue);
......
......@@ -96,7 +96,7 @@ namespace Leoxia.Testing.Reflection
decimal val = Convert<TimeSpan>(tested).Ticks;
if (val == 0)
{
trace.SetFailure("Tested Timespan is uninitialized.");
trace.SetFailure("Tested TimeSpan is uninitialized.");
return false;
}
return true;
......
......@@ -96,5 +96,45 @@ namespace Leoxia.Testing.Reflection
fieldInfo.SetValue(null, value);
return true;
}
public static PropertyInfo[] GetProperties(this Type type)
{
return type.GetTypeInfo().GetProperties();
}
public static Type[] GetGenericArguments(this Type type)
{
return type.GetTypeInfo().GetGenericArguments();
}
public static MethodInfo GetMethod(this Type type, string methodName, BindingFlags flags)
{
return type.GetTypeInfo().GetMethod(methodName, flags);
}
public static ConstructorInfo GetConstructor(this Type type, Type[] types)
{
return type.GetTypeInfo().GetConstructor(types);
}
public static PropertyInfo[] GetProperties(this Type type, BindingFlags flags)
{
return type.GetTypeInfo().GetProperties(flags);
}
public static PropertyInfo GetProperty(this Type type, string propertyName)
{
return type.GetTypeInfo().GetProperty(propertyName);
}
public static bool IsAssignableFrom(this Type type, Type other)
{
return type.GetTypeInfo().IsAssignableFrom(other);
}
public static ConstructorInfo[] GetConstructors(this Type type)
{
return type.GetTypeInfo().GetConstructors();
}
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Collections.Concurrent\Leoxia.Collections.Concurrent.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Checkers\Leoxia.Testing.Checkers.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
......
......@@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Collections\Leoxia.Collections.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Assertions\Leoxia.Testing.Assertions.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
......
......@@ -10,7 +10,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Graphs\Leoxia.Graphs.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Assertions\Leoxia.Testing.Assertions.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
......
......@@ -11,7 +11,9 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Log\Leoxia.Log.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Mocks\Leoxia.Testing.Mocks.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Reflection\Leoxia.Testing.Reflection.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Assertions\Leoxia.Testing.Assertions.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
......
......@@ -10,7 +10,6 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Network\Leoxia.Network.csproj" />
</ItemGroup>
<ItemGroup>
......
......@@ -7,9 +7,13 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Reflection\Leoxia.Testing.Reflection.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Assertions\Leoxia.Testing.Assertions.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Mocks\Leoxia.Testing.Mocks.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing.Checkers\Leoxia.Testing.Checkers.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
......
......@@ -12,7 +12,6 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Collections\Leoxia.Collections.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Log\Leoxia.Log.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Text.Extensions\Leoxia.Text.Extensions.csproj" />
</ItemGroup>
<ItemGroup>
......
......@@ -10,7 +10,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Leoxia.Graphs\Leoxia.Graphs.csproj" />
<ProjectReference Include="..\..\src\Leoxia.Testing\Leoxia.Testing.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment