From e2581a5797aa96ab548429b6c28230e33b5c4a44 Mon Sep 17 00:00:00 2001 From: Bo Stig Christensen Date: Sun, 24 Jul 2016 23:33:49 +0200 Subject: [PATCH 1/5] Upgraded NUnit to latest. Added Moq reference to test projects. Fixed BasicTests.DefaultPrimitiveTypePropertyToStringTest to have culture invariant string formatting. --- ExpressMapper.Tests NET40/BasicTests.cs | 17 +- .../ExpressMapper.Tests NET40.csproj | 15 +- ExpressMapper.Tests NET40/packages.config | 3 +- .../ExpressMapper.Tests NET45.csproj | 16 +- ExpressMapper.Tests NET45/packages.config | 6 + .../ExpressMapper.Tests NET451.csproj | 16 +- ExpressMapper.Tests NET451/packages.config | 6 + .../ExpressMapper.Tests.Projections.csproj | 4 +- .../packages.config | 2 +- packages/NUnit.2.6.4/NUnit.2.6.4.nupkg | Bin 99004 -> 0 bytes packages/NUnit.2.6.4/lib/nunit.framework.dll | Bin 151552 -> 0 bytes packages/NUnit.2.6.4/lib/nunit.framework.xml | 10984 ---------------- packages/NUnit.2.6.4/license.txt | 15 - 13 files changed, 63 insertions(+), 11021 deletions(-) create mode 100644 ExpressMapper.Tests NET45/packages.config create mode 100644 ExpressMapper.Tests NET451/packages.config delete mode 100644 packages/NUnit.2.6.4/NUnit.2.6.4.nupkg delete mode 100644 packages/NUnit.2.6.4/lib/nunit.framework.dll delete mode 100644 packages/NUnit.2.6.4/lib/nunit.framework.xml delete mode 100644 packages/NUnit.2.6.4/license.txt diff --git a/ExpressMapper.Tests NET40/BasicTests.cs b/ExpressMapper.Tests NET40/BasicTests.cs index 7f11641..1b81075 100644 --- a/ExpressMapper.Tests NET40/BasicTests.cs +++ b/ExpressMapper.Tests NET40/BasicTests.cs @@ -8,6 +8,7 @@ using NUnit.Framework; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Threading.Tasks; @@ -56,7 +57,7 @@ public void DefaultPrimitiveTypePropertyToStringTest() { Mapper.Register() .Member(dest => dest.TestString, src => src.TestDecimal); - Mapper.RegisterCustom(src => src.ToString("#0.00")); + Mapper.RegisterCustom(src => src.ToString("#0.00", CultureInfo.InvariantCulture)); Mapper.Compile(); var test = new TestDefaultDecimal() { TestDecimal = default(decimal) }; test.TestDecimal = default(decimal); @@ -413,14 +414,13 @@ public void BeforeMap() } [Test] - [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "BeforeMap already registered for ExpressMapper.Tests.Model.Models.Size")] public void BeforeMapDuplicateTest() { - Mapper.Register() + var exception = Assert.Throws(() => Mapper.Register() .Before((src, dest) => dest.Name = src.Name) .Before((src, dest) => dest.Name = src.Name) - .Ignore(dest => dest.Name); - Mapper.Compile(); + .Ignore(dest => dest.Name)); + Assert.That(exception.Message, Is.EqualTo("BeforeMap already registered for ExpressMapper.Tests.Model.Models.Size")); var sizeResult = Functional.BeforeMap(); var result = Mapper.Map(sizeResult.Key); @@ -439,13 +439,12 @@ public void AfterMap() } [Test] - [ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "AfterMap already registered for ExpressMapper.Tests.Model.Models.Size")] public void AfterMapDuplicateTest() { - Mapper.Register() + var exception = Assert.Throws(() => Mapper.Register() .After((src, dest) => dest.Name = "OVERRIDE BY AFTER MAP") - .After((src, dest) => dest.Name = "Duplicate map"); - Mapper.Compile(); + .After((src, dest) => dest.Name = "Duplicate map")); + Assert.That(exception.Message, Is.EqualTo("AfterMap already registered for ExpressMapper.Tests.Model.Models.Size")); var sizeResult = Functional.AfterMap(); var result = Mapper.Map(sizeResult.Key); Assert.AreEqual(result, sizeResult.Value); diff --git a/ExpressMapper.Tests NET40/ExpressMapper.Tests NET40.csproj b/ExpressMapper.Tests NET40/ExpressMapper.Tests NET40.csproj index 36adecb..e0ba566 100644 --- a/ExpressMapper.Tests NET40/ExpressMapper.Tests NET40.csproj +++ b/ExpressMapper.Tests NET40/ExpressMapper.Tests NET40.csproj @@ -36,8 +36,13 @@ 4 - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll + True + + + ..\packages\NUnit.3.4.1\lib\net40\nunit.framework.dll + True @@ -62,9 +67,6 @@ - - - {E701191E-BF2E-41B8-A4F0-3D8954E3DD58} @@ -75,6 +77,9 @@ ExpressMapper.Tests.Model + + + diff --git a/ExpressMapper.Tests NET40/packages.config b/ExpressMapper.Tests NET40/packages.config index c714ef3..b05d1a2 100644 --- a/ExpressMapper.Tests NET40/packages.config +++ b/ExpressMapper.Tests NET40/packages.config @@ -1,4 +1,5 @@  - + + \ No newline at end of file diff --git a/ExpressMapper.Tests NET45/ExpressMapper.Tests NET45.csproj b/ExpressMapper.Tests NET45/ExpressMapper.Tests NET45.csproj index 00f0e6c..0615260 100644 --- a/ExpressMapper.Tests NET45/ExpressMapper.Tests NET45.csproj +++ b/ExpressMapper.Tests NET45/ExpressMapper.Tests NET45.csproj @@ -33,8 +33,17 @@ false - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\Moq.4.5.16\lib\net45\Moq.dll + True + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True @@ -90,6 +99,9 @@ + + +