Browse Source

re-added tests46

af/merge-core
antonfirsov 9 years ago
parent
commit
0921bb8051
  1. 7
      ImageSharp.sln
  2. 2
      global.json
  3. 29
      tests/ImageSharp.Tests46/HelloTest.cs
  4. 179
      tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj
  5. 36
      tests/ImageSharp.Tests46/Properties/AssemblyInfo.cs
  6. 73
      tests/ImageSharp.Tests46/TestFile.cs
  7. 10
      tests/ImageSharp.Tests46/packages.config

7
ImageSharp.sln

@ -29,6 +29,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{815C06
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{56801022-D71A-4FBE-BC5B-CBA08E2284EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageSharp.Tests46", "tests\ImageSharp.Tests46\ImageSharp.Tests46.csproj", "{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -47,6 +49,10 @@ Global
{299D8E18-102C-42DE-ADBF-79098EE706A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{299D8E18-102C-42DE-ADBF-79098EE706A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{299D8E18-102C-42DE-ADBF-79098EE706A8}.Release|Any CPU.Build.0 = Release|Any CPU
{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -55,5 +61,6 @@ Global
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{F836E8E6-B4D9-4208-8346-140C74678B91} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{299D8E18-102C-42DE-ADBF-79098EE706A8} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
EndGlobalSection
EndGlobal

2
global.json

@ -1,6 +1,6 @@
{
"projects": [ "src" ],
"sdk": {
"version": "1.0.0-preview2-003121"
"version": "1.0.0-preview2-003131"
}
}

29
tests/ImageSharp.Tests46/HelloTest.cs

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ImageSharp.Tests
{
using Xunit;
using Xunit.Abstractions;
public class HelloTest
{
private ITestOutputHelper output;
public HelloTest(ITestOutputHelper output)
{
this.output = output;
}
[Fact]
public void HelloFoo()
{
TestFile file = TestFile.Create(TestImages.Jpeg.Calliphora);
var img = file.CreateImage();
this.output.WriteLine(img.Width.ToString());
}
}
}

179
tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{88C5FB74-5845-4CC0-8F1E-A25EBABC95C2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageSharp.Tests</RootNamespace>
<AssemblyName>ImageSharp.Tests46</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</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>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="ImageSharp" Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<HintPath>..\..\src\ImageSharp\bin\Debug\net45\ImageSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="ImageSharp" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<HintPath>..\..\src\ImageSharp\bin\Release\net45\ImageSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.1.1\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0-beta4-build3444\lib\net45\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0-beta4-build3444\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\Block8x8FTests.cs">
<Link>Formats\Jpg\Block8x8FTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\JpegTests.cs">
<Link>Formats\Jpg\JpegTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\ReferenceImplementations.cs">
<Link>Formats\Jpg\ReferenceImplementations.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\ReferenceImplementationsTests.cs">
<Link>Formats\Jpg\ReferenceImplementationsTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\UtilityTestClassBase.cs">
<Link>Formats\Jpg\UtilityTestClassBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\ImagePropertyTests.cs">
<Link>Image\ImagePropertyTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\ImageTests.cs">
<Link>Image\ImageTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\PixelAccessorTests.cs">
<Link>Image\PixelAccessorTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestBase.cs">
<Link>TestBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestImages.cs">
<Link>TestImages.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\ImageDataAttributeBase.cs">
<Link>TestUtilities\ImageDataAttributeBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithBlankImageAttribute.cs">
<Link>TestUtilities\WithBlankImageAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithFileAttribute.cs">
<Link>TestUtilities\WithFileAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithFileCollectionAttribute.cs">
<Link>TestUtilities\WithFileCollectionAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithMemberFactoryAttribute.cs">
<Link>TestUtilities\WithMemberFactoryAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithSolidFilledImagesAttribute.cs">
<Link>TestUtilities\WithSolidFilledImagesAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\EnumHelper.cs">
<Link>TestUtilities\EnumHelper.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Factories\GenericFactory.cs">
<Link>TestUtilities\GenericFactory.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Factories\ImageFactory.cs">
<Link>TestUtilities\ImageFactory.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\BlankProvider.cs">
<Link>TestUtilities\BlankProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\FileProvider.cs">
<Link>TestUtilities\FileProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\LambdaProvider.cs">
<Link>TestUtilities\LambdaProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\SolidProvider.cs">
<Link>TestUtilities\SolidProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\TestImageProvider.cs">
<Link>TestUtilities\TestImageProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImagingTestCaseUtility.cs">
<Link>TestUtilities\ImagingTestCaseUtility.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\PixelTypes.cs">
<Link>TestUtilities\PixelTypes.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Tests\TestImageProviderTests.cs">
<Link>TestUtilities\TestImageProviderTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Tests\TestUtilityExtensionsTests.cs">
<Link>TestUtilities\TestUtilityExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\TestUtilityExtensions.cs">
<Link>TestUtilities\TestUtilityExtensions.cs</Link>
</Compile>
<Compile Include="HelloTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestFile.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

36
tests/ImageSharp.Tests46/Properties/AssemblyInfo.cs

@ -0,0 +1,36 @@
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("ImageSharp.Tests46")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sapa")]
[assembly: AssemblyProduct("ImageSharp.Tests46")]
[assembly: AssemblyCopyright("Copyright © Sapa 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("88c5fb74-5845-4cc0-8f1e-a25ebabc95c2")]
// 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")]

73
tests/ImageSharp.Tests46/TestFile.cs

@ -0,0 +1,73 @@
// <copyright file="TestImage.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Tests
{
using System;
using System.Collections.Concurrent;
using System.IO;
public class TestFile
{
private static readonly ConcurrentDictionary<string, TestFile> cache = new ConcurrentDictionary<string, TestFile>();
private static readonly string FormatsDirectory = GetFormatsDirectory();
private static string GetFormatsDirectory()
{
return "../../../ImageSharp.Tests/TestImages/Formats/";
}
private readonly Image image;
private readonly string file;
private TestFile(string file)
{
this.file = file;
this.Bytes = File.ReadAllBytes(file);
this.image = new Image(this.Bytes);
}
public static TestFile Create(string file)
{
return cache.GetOrAdd(file, (string fileName) =>
{
return new TestFile(FormatsDirectory + fileName);
});
}
public byte[] Bytes { get; }
public string FileName
{
get
{
return Path.GetFileName(this.file);
}
}
public string FileNameWithoutExtension
{
get
{
return Path.GetFileNameWithoutExtension(this.file);
}
}
public string GetFileName(object value)
{
return this.FileNameWithoutExtension + "-" + value + Path.GetExtension(this.file);
}
public string GetFileNameWithoutExtension(object value)
{
return this.FileNameWithoutExtension + "-" + value;
}
public Image CreateImage()
{
return new Image(this.image);
}
}
}

10
tests/ImageSharp.Tests46/packages.config

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Numerics.Vectors" version="4.1.1" targetFramework="net461" />
<package id="xunit" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net461" />
<package id="xunit.assert" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.core" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.extensibility.core" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.extensibility.execution" version="2.2.0-beta4-build3444" targetFramework="net461" />
</packages>
Loading…
Cancel
Save