From 0921bb8051da9d299c6772423bd5e2ddc16fc77a Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Mon, 26 Dec 2016 03:08:39 +0100 Subject: [PATCH] re-added tests46 --- ImageSharp.sln | 7 + global.json | 2 +- tests/ImageSharp.Tests46/HelloTest.cs | 29 +++ .../ImageSharp.Tests46.csproj | 179 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 36 ++++ tests/ImageSharp.Tests46/TestFile.cs | 73 +++++++ tests/ImageSharp.Tests46/packages.config | 10 + 7 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 tests/ImageSharp.Tests46/HelloTest.cs create mode 100644 tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj create mode 100644 tests/ImageSharp.Tests46/Properties/AssemblyInfo.cs create mode 100644 tests/ImageSharp.Tests46/TestFile.cs create mode 100644 tests/ImageSharp.Tests46/packages.config diff --git a/ImageSharp.sln b/ImageSharp.sln index f05c47e40..b168c6340 100644 --- a/ImageSharp.sln +++ b/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 diff --git a/global.json b/global.json index 7346bdc28..6da79b611 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src" ], "sdk": { - "version": "1.0.0-preview2-003121" + "version": "1.0.0-preview2-003131" } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests46/HelloTest.cs b/tests/ImageSharp.Tests46/HelloTest.cs new file mode 100644 index 000000000..6a31d9bdd --- /dev/null +++ b/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()); + } + } +} diff --git a/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj b/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj new file mode 100644 index 000000000..d53ee3d9c --- /dev/null +++ b/tests/ImageSharp.Tests46/ImageSharp.Tests46.csproj @@ -0,0 +1,179 @@ + + + + + Debug + AnyCPU + {88C5FB74-5845-4CC0-8F1E-A25EBABC95C2} + Library + Properties + ImageSharp.Tests + ImageSharp.Tests46 + v4.6.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\src\ImageSharp\bin\Debug\net45\ImageSharp.dll + + + + + ..\..\src\ImageSharp\bin\Release\net45\ImageSharp.dll + + + + + + + + ..\..\packages\System.Numerics.Vectors.4.1.1\lib\net46\System.Numerics.Vectors.dll + True + + + + + + + + + ..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll + True + + + ..\..\packages\xunit.assert.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.assert.dll + True + + + ..\..\packages\xunit.extensibility.core.2.2.0-beta4-build3444\lib\net45\xunit.core.dll + True + + + ..\..\packages\xunit.extensibility.execution.2.2.0-beta4-build3444\lib\net45\xunit.execution.desktop.dll + True + + + + + Formats\Jpg\Block8x8FTests.cs + + + Formats\Jpg\JpegTests.cs + + + Formats\Jpg\ReferenceImplementations.cs + + + Formats\Jpg\ReferenceImplementationsTests.cs + + + Formats\Jpg\UtilityTestClassBase.cs + + + Image\ImagePropertyTests.cs + + + Image\ImageTests.cs + + + Image\PixelAccessorTests.cs + + + TestBase.cs + + + TestImages.cs + + + TestUtilities\ImageDataAttributeBase.cs + + + TestUtilities\WithBlankImageAttribute.cs + + + TestUtilities\WithFileAttribute.cs + + + TestUtilities\WithFileCollectionAttribute.cs + + + TestUtilities\WithMemberFactoryAttribute.cs + + + TestUtilities\WithSolidFilledImagesAttribute.cs + + + TestUtilities\EnumHelper.cs + + + TestUtilities\GenericFactory.cs + + + TestUtilities\ImageFactory.cs + + + TestUtilities\BlankProvider.cs + + + TestUtilities\FileProvider.cs + + + TestUtilities\LambdaProvider.cs + + + TestUtilities\SolidProvider.cs + + + TestUtilities\TestImageProvider.cs + + + TestUtilities\ImagingTestCaseUtility.cs + + + TestUtilities\PixelTypes.cs + + + TestUtilities\TestImageProviderTests.cs + + + TestUtilities\TestUtilityExtensionsTests.cs + + + TestUtilities\TestUtilityExtensions.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/ImageSharp.Tests46/Properties/AssemblyInfo.cs b/tests/ImageSharp.Tests46/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d16593ab0 --- /dev/null +++ b/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")] diff --git a/tests/ImageSharp.Tests46/TestFile.cs b/tests/ImageSharp.Tests46/TestFile.cs new file mode 100644 index 000000000..95e2fc083 --- /dev/null +++ b/tests/ImageSharp.Tests46/TestFile.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// +namespace ImageSharp.Tests +{ + using System; + using System.Collections.Concurrent; + using System.IO; + + public class TestFile + { + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + 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); + } + } +} diff --git a/tests/ImageSharp.Tests46/packages.config b/tests/ImageSharp.Tests46/packages.config new file mode 100644 index 000000000..4eced5344 --- /dev/null +++ b/tests/ImageSharp.Tests46/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file