Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding .net Core compatible PCL #8

Merged
merged 2 commits into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.suo
[Dd]ebug/
*.user
Compare-NET-Objects-NewPcl-Tests/TestResult.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>57bc44d1-5a46-4000-851a-d858dc98867e</ProjectGuid>
<RootNamespace>Compare_Net_Objects_NewPcl_Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
29 changes: 29 additions & 0 deletions Compare-NET-Objects-NewPcl-Tests/CompareLogicTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using KellermanSoftware.CompareNetObjects;
using KellermanSoftware.CompareNetObjectsTests.TestClasses;
using NUnit.Framework;

namespace Compare_Net_Objects_NewPcl_Tests
{
[TestFixture]
public class CompareLogicTests
{
[Test]
public void Compare_IndexerCompareAndPropertyComparePositive()
{
var jane = new Person {Name = "Jane"};
var mary = new Person {Name = "Mary"};
var jack = new Person {Name = "Jack"};

var nameList1 = new List<Person>() {jane, jack, mary};
var nameList2 = new List<Person>() {jane, jack, mary};

var class1 = new ListClass<Person>(nameList1);
var class2 = new ListClass<Person>(nameList2);

var compare = new CompareLogic();
Assert.IsTrue(compare.Compare(class1, class2).AreEqual);
}
}
}
18 changes: 18 additions & 0 deletions Compare-NET-Objects-NewPcl-Tests/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Reflection;
using NUnitLite;

namespace Compare_NET_Objects_Core.Tests
{
public class Program
{
public static int Main(string[] args)
{
#if DNX451
return new AutoRun().Execute(args);
#else
return new AutoRun().Execute(typeof(Program).GetTypeInfo().Assembly, Console.Out, Console.In, args);
#endif
}
}
}
23 changes: 23 additions & 0 deletions Compare-NET-Objects-NewPcl-Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Compare_Net_Objects_NewPcl_Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Compare_Net_Objects_NewPcl_Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("57bc44d1-5a46-4000-851a-d858dc98867e")]
27 changes: 27 additions & 0 deletions Compare-NET-Objects-NewPcl-Tests/TypeHelperTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using KellermanSoftware.CompareNetObjects;

namespace Compare_NET_Objects_Core.Tests
{
[TestFixture]
public class TypeHelperTests
{
[Test]
public void IsByteArray()
{
var enumerable = new byte[] { 3, 5, 7, 8, 9 };
var type = enumerable.GetType();
Assert.That(TypeHelper.IsByteArray(type));
}

[Test]
public void IsEnumerable()
{
var enumerable = new List<int> { 3, 5, 7, 8, 9}.Where(i => i > 4);
var type = enumerable.GetType();
Assert.That(TypeHelper.IsEnumerable(type));
}
}
}
40 changes: 40 additions & 0 deletions Compare-NET-Objects-NewPcl-Tests/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "1.0.0-*",
"description": "Compare-Net-Objects-NewPcl-Tests Console Application",
"authors": [ "Stephenh" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",

"compile": [
"../Compare-NET-Objects-Tests/TestClasses/IName.cs",
"../Compare-NET-Objects-Tests/TestClasses/ListClass.cs",
"../Compare-NET-Objects-Tests/TestClasses/Person.cs"
],

"compilationOptions": {
"emitEntryPoint": true
},

"dependencies": {
"Compare-NET-Objects-NewPcl": "1.0.0-*",
"NUnitLite": "3.0.1"
},

"commands": {
"Compare_Net_Objects_NewPcl_Tests": "Compare_Net_Objects_NewPcl_Tests"
},

"frameworks": {
"dnx451": { },
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23516",
"System.Collections": "4.0.11-beta-23516",
"System.Console": "4.0.0-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Threading": "4.0.11-beta-23516"
}
}
}
}
Loading