Browse Source

Bring back the tests, now also a "Class Library (Package" project - followed examples here https://xunit.github.io/docs/getting-started-dnx.html

Former-commit-id: c8a5e50f94e3c8d917efe02aaba39283e5bc6bb9
Former-commit-id: 24c1653dcea127c882bcfbdb13beb02f6b24b20d
Former-commit-id: 7173d7fe842a72a5b04bba45be924adb0b07c454
pull/17/head
Jeavon 10 years ago
parent
commit
427f5724ec
  1. 6
      ImageProcessor.sln
  2. 1
      build/aspnet5-version.js
  3. 3
      src/ImageProcessor/Common/Helpers/Guard.cs
  4. 24
      src/ImageProcessor/project.json
  5. 2
      src/ImageProcessor/project.lock.json.REMOVED.git-id
  6. 90
      tests/ImageProcessor.Tests/ImageProcessor.Tests.csproj
  7. 9
      tests/ImageProcessor.Tests/ImageProcessor.Tests.csproj.DotSettings
  8. 2
      tests/ImageProcessor.Tests/Processors/Filters/FilterTests.cs
  9. 6
      tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs
  10. 21
      tests/ImageProcessor.Tests/Properties/AssemblyInfo.cs
  11. 20
      tests/ImageProcessor.Tests/packages.config
  12. 29
      tests/ImageProcessor.Tests/project.json
  13. 1
      tests/ImageProcessor.Tests/project.lock.json.REMOVED.git-id

6
ImageProcessor.sln

@ -5,6 +5,8 @@ VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ImageProcessor", "src\ImageProcessor\ImageProcessor.xproj", "{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ImageProcessor.Tests", "tests\ImageProcessor.Tests\ImageProcessor.Tests.xproj", "{F836E8E6-B4D9-4208-8346-140C74678B91}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -15,6 +17,10 @@ Global
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}.Release|Any CPU.Build.0 = Release|Any CPU
{F836E8E6-B4D9-4208-8346-140C74678B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F836E8E6-B4D9-4208-8346-140C74678B91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F836E8E6-B4D9-4208-8346-140C74678B91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F836E8E6-B4D9-4208-8346-140C74678B91}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

1
build/aspnet5-version.js

@ -1,6 +1,5 @@
var jsonfile = require('jsonfile');
var semver = require('semver');
var util = require('util');
var file = '../src/imageprocessor/project.json';
var buildVersion = process.env.APPVEYOR_BUILD_VERSION.substring(1);

3
src/ImageProcessor/Common/Helpers/Guard.cs

@ -8,6 +8,9 @@
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("ImageProcessor.Tests")]
namespace ImageProcessor
{
using System;

24
src/ImageProcessor/project.json

@ -1,11 +1,14 @@
{
"version": "3.0.0-*",
"description": "ImageProcessor",
"authors": [ "James Jackson-South" ],
"tags": [ "Image Resize Crop Quality Gif Jpg Jpeg Bitmap Png Fluent Animated" ],
"projectUrl": "",
"licenseUrl": "",
"version": "3.0.0-*",
"description": "ImageProcessor",
"authors": [
"James Jackson-South"
],
"tags": [
"Image Resize Crop Quality Gif Jpg Jpeg Bitmap Png Fluent Animated"
],
"projectUrl": "",
"licenseUrl": "",
"dependencies": {
"System.Collections": "4.0.10",
"System.Linq": "4.0.0",
@ -20,8 +23,7 @@
"Microsoft.NETCore": "5.0.1-beta-23409",
"Microsoft.NETCore.Platforms": "1.0.1-beta-23409"
},
"frameworks": {
"dotnet": { }
}
"frameworks": {
"dnxcore50": {}
}
}

2
src/ImageProcessor/project.lock.json.REMOVED.git-id

@ -1 +1 @@
869b4da8e5d4467a9e8fe7af0413a80080cd8f15
b4afca3213a5d2714e409729a1ef2622b62a5bca

90
tests/ImageProcessor.Tests/ImageProcessor.Tests.csproj

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1741DC66-5404-4B15-AE58-B7721F1568A4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageProcessor.Tests</RootNamespace>
<AssemblyName>ImageProcessor.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Collections.Immutable, Version=1.1.37.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Collections.Immutable.1.1.37\lib\dotnet\System.Collections.Immutable.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.1.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Colors\ColorConversionTests.cs" />
<Compile Include="Colors\ColorTests.cs" />
<Compile Include="Processors\Filters\FilterTests.cs" />
<Compile Include="Processors\Formats\EncoderDecoderTests.cs" />
<Compile Include="Helpers\GuardTests.cs" />
<Compile Include="Numerics\RectangleTests.cs" />
<Compile Include="Numerics\PointTests.cs" />
<Compile Include="Numerics\SizeTests.cs" />
<Compile Include="Processors\ProcessorTestBase.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Processors\Samplers\SamplerTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
</Project>

9
tests/ImageProcessor.Tests/ImageProcessor.Tests.csproj.DotSettings

@ -1,9 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=colors/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=formats/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=helpers/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=numerics/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=processors/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=processors_005Cfilters/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=processors_005Cformats/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=processors_005Csamplers/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

2
tests/ImageProcessor.Tests/Processors/Filters/FilterTests.cs

@ -17,7 +17,7 @@ namespace ImageProcessor.Tests
{ "Brightness--50", new Brightness(-50) },
{ "Contrast-50", new Contrast(50) },
{ "Contrast--50", new Contrast(-50) },
{ "Blend", new Blend(new Image(File.OpenRead("../../TestImages/Formats/Bmp/Car.bmp")),15)},
{ "Blend", new Blend(new Image(File.OpenRead("TestImages/Formats/Bmp/Car.bmp")),15)},
{ "Saturation-50", new Saturation(50) },
{ "Saturation--50", new Saturation(-50) },
{ "Alpha--50", new Alpha(50) },

6
tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs

@ -21,7 +21,7 @@ namespace ImageProcessor.Tests
{
//"../../TestImages/Formats/Jpg/Backdrop.jpg",
//"../../TestImages/Formats/Jpg/Calliphora.jpg",
"../../TestImages/Formats/Jpg/china.jpg",
"TestImages/Formats/Jpg/china.jpg",
//"../../TestImages/Formats/Jpg/ant.jpg",
//"../../TestImages/Formats/Jpg/parachute.jpg",
//"../../TestImages/Formats/Jpg/lomo.jpg",
@ -29,10 +29,10 @@ namespace ImageProcessor.Tests
//"../../TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg",
//"../../TestImages/Formats/Jpg/greyscale.jpg",
//"../../TestImages/Formats/Bmp/Car.bmp",
"../../TestImages/Formats/Png/cballs.png",
"TestImages/Formats/Png/cballs.png",
//"../../TestImages/Formats/Png/cmyk.png",
//"../../TestImages/Formats/Png/gamma-1.0-or-2.2.png",
"../../TestImages/Formats/Png/splash.png",
"TestImages/Formats/Png/splash.png",
//"../../TestImages/Formats/Gif/leaf.gif",
//"../../TestImages/Formats/Gif/ben2.gif",
//"../../TestImages/Formats/Gif/rings.gif",

21
tests/ImageProcessor.Tests/Properties/AssemblyInfo.cs

@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// 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")]
@ -14,23 +14,10 @@ using System.Runtime.InteropServices;
[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
// 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("8fea7d87-3f18-465a-b15f-abb1783c95bc")]
// 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")]
[assembly: Guid("f836e8e6-b4d9-4208-8346-140c74678b91")]

20
tests/ImageProcessor.Tests/packages.config

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Collections" version="4.0.0" targetFramework="net46" />
<package id="System.Collections.Immutable" version="1.1.37" targetFramework="net46" />
<package id="System.Diagnostics.Debug" version="4.0.0" targetFramework="net46" />
<package id="System.Globalization" version="4.0.10" targetFramework="net46" />
<package id="System.Linq" version="4.0.0" targetFramework="net46" />
<package id="System.Numerics.Vectors" version="4.1.0" targetFramework="net46" />
<package id="System.Resources.ResourceManager" version="4.0.0" targetFramework="net46" />
<package id="System.Runtime" version="4.0.20" targetFramework="net46" />
<package id="System.Runtime.Extensions" version="4.0.10" targetFramework="net46" />
<package id="System.Threading" version="4.0.0" targetFramework="net46" />
<package id="xunit" version="2.0.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.runner.console" version="2.0.0" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" />
</packages>

29
tests/ImageProcessor.Tests/project.json

@ -0,0 +1,29 @@
{
"version": "1.0.0-*",
"description": "ImageProcessor.Tests Class Library",
"authors": [ "jeavon" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"frameworks": {
"dnxcore50": {
"dependencies": {
"Microsoft.CSharp": "4.0.1-beta-23409",
"System.Collections": "4.0.11-beta-23409",
"System.Linq": "4.0.1-beta-23409",
"System.Runtime": "4.0.21-beta-23409",
"System.Threading": "4.0.11-beta-23409"
}
}
},
"dependencies": {
"ImageProcessor": "3.0.0-*",
"Microsoft.NETCore": "5.0.1-beta-23409",
"Microsoft.NETCore.Platforms": "1.0.1-beta-23409",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-beta6-build191"
},
"commands": {
"test": "xunit.runner.dnx"
}
}

1
tests/ImageProcessor.Tests/project.lock.json.REMOVED.git-id

@ -0,0 +1 @@
986564cced9c1356c73f345d4f605395896bf156
Loading…
Cancel
Save