From c256d9b07e03870080976ac2a508a6bf2490c88b Mon Sep 17 00:00:00 2001 From: Thomas Broust Date: Wed, 25 Jun 2014 17:48:47 +0200 Subject: [PATCH] New unit tests project using NUnit instead of VS tests Former-commit-id: fdb9bf359884a5b8f168228ac45a8e194e4d3d1d --- .gitignore | 3 + .../ImageProcessor.Tests.csproj | 112 ------------------ .../Properties/AssemblyInfo.cs | 36 ------ src/ImageProcessor.Tests/app.config | 15 --- .../ImageProcessor.UnitTests.csproj | 52 ++++++++ .../RegularExpressionUnitTests.cs | 47 +++----- src/ImageProcessor.UnitTests/packages.config | 4 + src/packages/repositories.config | 13 +- 8 files changed, 83 insertions(+), 199 deletions(-) delete mode 100644 src/ImageProcessor.Tests/ImageProcessor.Tests.csproj delete mode 100644 src/ImageProcessor.Tests/Properties/AssemblyInfo.cs delete mode 100644 src/ImageProcessor.Tests/app.config create mode 100644 src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj rename src/{ImageProcessor.Tests => ImageProcessor.UnitTests}/RegularExpressionUnitTests.cs (86%) create mode 100644 src/ImageProcessor.UnitTests/packages.config diff --git a/.gitignore b/.gitignore index 6b6928926..2fc43e4a1 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,9 @@ local.properties .builds **/*.dotCover +# Xamarin +*.userprefs + ## TODO: If you have NuGet Package Restore enabled, uncomment this packages/ diff --git a/src/ImageProcessor.Tests/ImageProcessor.Tests.csproj b/src/ImageProcessor.Tests/ImageProcessor.Tests.csproj deleted file mode 100644 index 3d3e5c241..000000000 --- a/src/ImageProcessor.Tests/ImageProcessor.Tests.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - {39911A38-CA06-413C-80AA-39EF60CE984F} - Library - Properties - ImageProcessor.Tests - ImageProcessor.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - AnyCPU - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - {3b5dd734-fb7a-487d-8ce6-55e7af9aea7e} - ImageProcessor - - - - - - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file diff --git a/src/ImageProcessor.Tests/Properties/AssemblyInfo.cs b/src/ImageProcessor.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index e2341f344..000000000 --- a/src/ImageProcessor.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -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("ImageProcessor.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ImageProcessor.Tests")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[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("ab617b65-7259-4dc5-9dad-81a7c6537a4f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ImageProcessor.Tests/app.config b/src/ImageProcessor.Tests/app.config deleted file mode 100644 index 7d285c859..000000000 --- a/src/ImageProcessor.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj b/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj new file mode 100644 index 000000000..5552927ec --- /dev/null +++ b/src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj @@ -0,0 +1,52 @@ + + + + Debug + AnyCPU + {03CA9055-F997-428C-BF28-F50F991777C6} + Library + ImageProcessor.UnitTests + ImageProcessor.UnitTests + Client + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + false + + + full + true + bin\Release + prompt + 4 + false + + + + + + ..\packages\NUnit.2.6.3\lib\nunit.framework.dll + + + + + + + + + + + {3B5DD734-FB7A-487D-8CE6-55E7AF9AEA7E} + ImageProcessor + + + + + + \ No newline at end of file diff --git a/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs b/src/ImageProcessor.UnitTests/RegularExpressionUnitTests.cs similarity index 86% rename from src/ImageProcessor.Tests/RegularExpressionUnitTests.cs rename to src/ImageProcessor.UnitTests/RegularExpressionUnitTests.cs index 84e1d6c5b..280af264e 100644 --- a/src/ImageProcessor.Tests/RegularExpressionUnitTests.cs +++ b/src/ImageProcessor.UnitTests/RegularExpressionUnitTests.cs @@ -1,31 +1,18 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) James South. -// Licensed under the Apache License, Version 2.0. -// -// ----------------------------------------------------------------------- -namespace ImageProcessor.Tests +namespace ImageProcessor.UnitTests { - #region Using + using System; using System.Drawing; using ImageProcessor.Imaging; using ImageProcessor.Processors; - using Microsoft.VisualStudio.TestTools.UnitTesting; - #endregion - - /// - /// The regular expression unit tests. - /// This is a work in progress. YAWN! - /// - [TestClass] + using NUnit.Framework; + + [TestFixture ()] public class RegularExpressionUnitTests { - #region Regular Expression Tests - /// /// The alpha regex unit test. /// - [TestMethod] + [Test ()] public void TestAlphaRegex() { const string Querystring = "alpha=56"; @@ -42,7 +29,7 @@ namespace ImageProcessor.Tests /// /// The brightness regex unit test. /// - [TestMethod] + [Test ()] public void TestBrightnessRegex() { const string Querystring = "brightness=56"; @@ -59,7 +46,7 @@ namespace ImageProcessor.Tests /// /// The contrast regex unit test. /// - [TestMethod] + [Test ()] public void TestContrastRegex() { const string Querystring = "contrast=56"; @@ -76,7 +63,7 @@ namespace ImageProcessor.Tests /// /// The rotate regex unit test. /// - [TestMethod] + [Test ()] public void TestCropRegex() { const string Querystring = "crop=0,0,150,300"; @@ -92,7 +79,7 @@ namespace ImageProcessor.Tests /// /// The filter regex unit test. /// - [TestMethod] + [Test ()] public void TestFilterRegex() { // Should really write more for the other filters. @@ -110,7 +97,7 @@ namespace ImageProcessor.Tests /// /// The format regex unit test. /// - [TestMethod] + [Test ()] public void TestFormatRegex() { const string Querystring = "format=gif"; @@ -127,7 +114,7 @@ namespace ImageProcessor.Tests /// /// The quality regex unit test. /// - [TestMethod] + [Test ()] public void TestQualityRegex() { const string Querystring = "quality=56"; @@ -144,7 +131,7 @@ namespace ImageProcessor.Tests /// /// The resize regex unit test. /// - [TestMethod] + [Test ()] public void TestResizeRegex() { const string Querystring = "width=300"; @@ -161,7 +148,7 @@ namespace ImageProcessor.Tests /// /// The rotate regex unit test. /// - [TestMethod] + [Test ()] public void TestRotateRegex() { const string Querystring = "rotate=270"; @@ -178,7 +165,7 @@ namespace ImageProcessor.Tests /// /// The rounded corners regex unit test. /// - [TestMethod] + [Test ()] public void TestRoundedCornersRegex() { const string Querystring = "roundedcorners=30"; @@ -195,7 +182,7 @@ namespace ImageProcessor.Tests /// /// The rounded corners regex unit test. /// - [TestMethod] + [Test ()] public void TestTintRegex() { const string HexQuerystring = "tint=6aa6cc"; @@ -213,6 +200,6 @@ namespace ImageProcessor.Tests Color actualRgba = tint.DynamicParameter; Assert.AreEqual(expectedRgba, actualRgba); } - #endregion } } + diff --git a/src/ImageProcessor.UnitTests/packages.config b/src/ImageProcessor.UnitTests/packages.config new file mode 100644 index 000000000..5a3253fcb --- /dev/null +++ b/src/ImageProcessor.UnitTests/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/packages/repositories.config b/src/packages/repositories.config index 458c0f4aa..73ccce20c 100644 --- a/src/packages/repositories.config +++ b/src/packages/repositories.config @@ -1,7 +1,8 @@ - - - - - - + + + + + + + \ No newline at end of file