diff --git a/build/Program.cs b/build/Program.cs index 6e04dc1df..4e59b2214 100644 --- a/build/Program.cs +++ b/build/Program.cs @@ -63,21 +63,21 @@ namespace ConsoleApplication /// The arguments. public static void Main(string[] args) { - var resetmode = args.Contains("reset"); + bool resetmode = args.Contains("reset"); // Find the project root - var root = Path.GetFullPath(Path.Combine(LibGit2Sharp.Repository.Discover("."), "..")); + string root = Path.GetFullPath(Path.Combine(LibGit2Sharp.Repository.Discover("."), "..")); // Lets find the repo - var repo = new LibGit2Sharp.Repository(root); + Repository repo = new LibGit2Sharp.Repository(root); // Lets find all the project.json files in the src folder (don't care about versioning `tests`) - var projectFiles = Directory.EnumerateFiles(Path.Combine(root, "src"), "*.csproj", SearchOption.AllDirectories); + IEnumerable projectFiles = Directory.EnumerateFiles(Path.Combine(root, "src"), "*.csproj", SearchOption.AllDirectories); ResetProject(projectFiles); // Open them and convert them to source projects - var projects = projectFiles.Select(x => ProjectRootElement.Open(x, ProjectCollection.GlobalProjectCollection, true)) + List projects = projectFiles.Select(x => ProjectRootElement.Open(x, ProjectCollection.GlobalProjectCollection, true)) .Select(x => new SourceProject(x, repo.Info.WorkingDirectory)) .ToList(); @@ -89,7 +89,7 @@ namespace ConsoleApplication CreateBuildScript(projects, root); - foreach (var p in projects) + foreach (SourceProject p in projects) { Console.WriteLine($"{p.Name} {p.FinalVersionNumber}"); } @@ -98,10 +98,10 @@ namespace ConsoleApplication private static void CreateBuildScript(IEnumerable projects, string root) { - var outputDir = Path.GetFullPath(Path.Combine(root, @"artifacts\bin\ImageSharp")); + string outputDir = Path.GetFullPath(Path.Combine(root, @"artifacts\bin\ImageSharp")); - var sb = new StringBuilder(); - foreach (var p in projects) + StringBuilder sb = new StringBuilder(); + foreach (SourceProject p in projects) { sb.AppendLine($@"dotnet pack --configuration Release --output ""{outputDir}"" ""{p.ProjectFilePath}"""); } @@ -111,17 +111,17 @@ namespace ConsoleApplication private static void UpdateVersionNumbers(IEnumerable projects) { - foreach (var p in projects) + foreach (SourceProject p in projects) { // create a backup file so we can rollback later without breaking formatting File.Copy(p.FullProjectFilePath, $"{p.FullProjectFilePath}.bak", true); } - foreach (var p in projects) + foreach (SourceProject p in projects) { // TODO force update of all dependent projects to point to the newest build. // we skip the build number and standard CI prefix on first commits - var newVersion = p.FinalVersionNumber; + string newVersion = p.FinalVersionNumber; p.UpdateVersion(newVersion); } @@ -133,13 +133,13 @@ namespace ConsoleApplication string branch = repo.Head.FriendlyName; // lets see if we are running in appveyor and if we are use the environment variables instead of the head - var appveryorBranch = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"); + string appveryorBranch = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"); if (!string.IsNullOrWhiteSpace(appveryorBranch)) { branch = appveryorBranch; } - var prNumber = Environment.GetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"); + string prNumber = Environment.GetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"); if (!string.IsNullOrWhiteSpace(prNumber)) { branch = $"PR{int.Parse(prNumber):000}"; @@ -159,7 +159,7 @@ namespace ConsoleApplication private static void CaclulateProjectVersionNumber(List projects, Repository repo) { - var branch = CurrentBranch(repo); + string branch = CurrentBranch(repo); // populate the dependency chains projects.ForEach(x => x.PopulateDependencies(projects)); @@ -176,7 +176,7 @@ namespace ConsoleApplication } // revert the project.json change be reverting it but skipp all the git stuff as its not needed - foreach (var p in projectPaths) + foreach (string p in projectPaths) { if (File.Exists($"{p}.bak")) { @@ -303,7 +303,7 @@ namespace ConsoleApplication /// The branch. internal void CalculateVersion(Repository repo, string branch) { - foreach (var c in repo.Commits) + foreach (Commit c in repo.Commits) { if (!this.ApplyCommit(c, repo)) { @@ -335,7 +335,7 @@ namespace ConsoleApplication this.CommitCountSinceVersionChange++; // return false if this is a version number root - var projectFileChange = changes.Where(x => x.Path?.Equals(this.ProjectFilePath, StringComparison.OrdinalIgnoreCase) == true).FirstOrDefault(); + TreeEntryChanges projectFileChange = changes.Where(x => x.Path?.Equals(this.ProjectFilePath, StringComparison.OrdinalIgnoreCase) == true).FirstOrDefault(); if (projectFileChange != null) { if (projectFileChange.Status == ChangeKind.Added) @@ -345,13 +345,13 @@ namespace ConsoleApplication } else { - var blob = repo.Lookup(projectFileChange.Oid); - using (var s = blob.GetContentStream()) + Blob blob = repo.Lookup(projectFileChange.Oid); + using (Stream s = blob.GetContentStream()) { - using (var reader = XmlReader.Create(s)) + using (XmlReader reader = XmlReader.Create(s)) { - var proj = ProjectRootElement.Create(reader); - var version = new NuGetVersion(proj.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value); + ProjectRootElement proj = ProjectRootElement.Create(reader); + NuGetVersion version = new NuGetVersion(proj.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value); if (version != this.Version) { // version changed @@ -370,9 +370,9 @@ namespace ConsoleApplication private bool ApplyCommit(Commit commit, Repository repo) { - foreach (var parent in commit.Parents) + foreach (Commit parent in commit.Parents) { - var changes = repo.Diff.Compare(parent.Tree, commit.Tree); + TreeChanges changes = repo.Diff.Compare(parent.Tree, commit.Tree); foreach (TreeEntryChanges change in changes) { @@ -399,7 +399,7 @@ namespace ConsoleApplication private string CalculateVersionNumber(string branch) { - var version = this.Version.ToFullString(); + string version = this.Version.ToFullString(); // master only if (this.CommitCountSinceVersionChange == 1 && branch == "master") @@ -414,12 +414,12 @@ namespace ConsoleApplication return version; } - var rootSpecialVersion = string.Empty; + string rootSpecialVersion = string.Empty; if (this.Version.IsPrerelease) { // probably a much easy way for doing this but it work sell enough for a build script - var parts = version.Split(new[] { '-' }, 2); + string[] parts = version.Split(new[] { '-' }, 2); version = parts[0]; rootSpecialVersion = parts[1]; } @@ -447,7 +447,7 @@ namespace ConsoleApplication branch = "-" + branch; } - var maxLength = 20; // dotnet will fail to populate the package if the tag is > 20 + int maxLength = 20; // dotnet will fail to populate the package if the tag is > 20 maxLength -= rootSpecialVersion.Length; // this is a required tag maxLength -= 7; // for the counter and dashes diff --git a/src/ImageSharp.Drawing/Brushes/ImageBrush{TColor}.cs b/src/ImageSharp.Drawing/Brushes/ImageBrush{TColor}.cs index 2707c0064..732cd4f8b 100644 --- a/src/ImageSharp.Drawing/Brushes/ImageBrush{TColor}.cs +++ b/src/ImageSharp.Drawing/Brushes/ImageBrush{TColor}.cs @@ -91,7 +91,7 @@ namespace ImageSharp.Drawing.Brushes { get { - var point = new Vector2(x, y); + Vector2 point = new Vector2(x, y); // Offset the requested pixel by the value in the rectangle (the shapes position) point = point - this.offset; diff --git a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TColor}.cs b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TColor}.cs index 542c3cfed..db8f3705e 100644 --- a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TColor}.cs +++ b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TColor}.cs @@ -124,7 +124,7 @@ namespace ImageSharp.Drawing.Brushes float distance = Vector4.DistanceSquared(background, this.sourceColor); if (distance <= this.threshold) { - var lerpAmount = (this.threshold - distance) / this.threshold; + float lerpAmount = (this.threshold - distance) / this.threshold; Vector4 blended = Vector4BlendTransforms.PremultipliedLerp( background, this.targetColor, diff --git a/src/ImageSharp.Drawing/Pens/Pen{TColor}.cs b/src/ImageSharp.Drawing/Pens/Pen{TColor}.cs index 79a5d6b15..ffcc5ee75 100644 --- a/src/ImageSharp.Drawing/Pens/Pen{TColor}.cs +++ b/src/ImageSharp.Drawing/Pens/Pen{TColor}.cs @@ -146,7 +146,7 @@ namespace ImageSharp.Drawing.Pens public override ColoredPointInfo GetColor(int x, int y, PointInfo info) { - var result = default(ColoredPointInfo); + ColoredPointInfo result = default(ColoredPointInfo); result.Color = this.brush[x, y]; if (info.DistanceFromPath < this.halfWidth) @@ -178,7 +178,7 @@ namespace ImageSharp.Drawing.Pens this.pattern = new float[pattern.Length + 1]; this.pattern[0] = 0; - for (var i = 0; i < pattern.Length; i++) + for (int i = 0; i < pattern.Length; i++) { this.totalLength += pattern[i] * width; this.pattern[i + 1] = this.totalLength; @@ -199,10 +199,10 @@ namespace ImageSharp.Drawing.Pens public override ColoredPointInfo GetColor(int x, int y, PointInfo info) { - var infoResult = default(ColoredPointInfo); + ColoredPointInfo infoResult = default(ColoredPointInfo); infoResult.DistanceFromElement = float.MaxValue; // is really outside the element - var length = info.DistanceAlongPath % this.totalLength; + float length = info.DistanceAlongPath % this.totalLength; // we can treat the DistanceAlongPath and DistanceFromPath as x,y coords for the pattern // we need to calcualte the distance from the outside edge of the pattern @@ -221,10 +221,10 @@ namespace ImageSharp.Drawing.Pens distanceWAway = info.DistanceFromPath - this.halfWidth; } - for (var i = 0; i < this.pattern.Length - 1; i++) + for (int i = 0; i < this.pattern.Length - 1; i++) { - var start = this.pattern[i]; - var end = this.pattern[i + 1]; + float start = this.pattern[i]; + float end = this.pattern[i + 1]; if (length >= start && length < end) { @@ -238,12 +238,12 @@ namespace ImageSharp.Drawing.Pens else { // this is a none solid part - var distanceFromStart = length - start; - var distanceFromEnd = end - length; + float distanceFromStart = length - start; + float distanceFromEnd = end - length; - var closestEdge = Math.Min(distanceFromStart, distanceFromEnd); + float closestEdge = Math.Min(distanceFromStart, distanceFromEnd); - var distanceAcross = closestEdge; + float distanceAcross = closestEdge; if (distanceWAway > 0) { diff --git a/src/ImageSharp/Colors/PackedPixel/Argb.cs b/src/ImageSharp/Colors/PackedPixel/Argb.cs index 70fd7de8a..d03c098cd 100644 --- a/src/ImageSharp/Colors/PackedPixel/Argb.cs +++ b/src/ImageSharp/Colors/PackedPixel/Argb.cs @@ -307,7 +307,7 @@ namespace ImageSharp [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint Pack(float x, float y, float z, float w) { - var value = new Vector4(x, y, z, w); + Vector4 value = new Vector4(x, y, z, w); return Pack(ref value); } @@ -333,7 +333,7 @@ namespace ImageSharp [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint Pack(ref Vector3 vector) { - var value = new Vector4(vector, 1); + Vector4 value = new Vector4(vector, 1); return Pack(ref value); } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs index 85018a06f..0acee3a10 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs @@ -71,8 +71,8 @@ namespace ImageSharp.Formats.Jpg DCT.TransformIDCT(ref *b, ref *this.pointers.Temp1, ref *this.pointers.Temp2); - var destChannel = decoder.GetDestinationChannel(this.componentIndex); - var destArea = destChannel.GetOffsetedSubAreaForBlock(decodedBlock.Bx, decodedBlock.By); + JpegPixelArea destChannel = decoder.GetDestinationChannel(this.componentIndex); + JpegPixelArea destArea = destChannel.GetOffsetedSubAreaForBlock(decodedBlock.Bx, decodedBlock.By); destArea.LoadColorsFrom(this.pointers.Temp1, this.pointers.Temp2); } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs index 9fe6fecec..728da8d02 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs @@ -78,7 +78,7 @@ namespace ImageSharp.Formats.Jpg public static JpegPixelArea CreatePooled(int width, int height) { int size = width * height; - var pixels = BytePool.Rent(size); + byte[] pixels = BytePool.Rent(size); return new JpegPixelArea(pixels, width, 0); } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs index 10f859e42..c6362a871 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs @@ -305,7 +305,7 @@ namespace ImageSharp.Formats.Jpg /// The index of the scan private void DecodeBlock(JpegDecoderCore decoder, int scanIndex) { - var b = this.pointers.Block; + Block8x8F* b = this.pointers.Block; int huffmannIdx = (HuffmanTree.AcTableIndex * HuffmanTree.ThRowSize) + this.pointers.ComponentScan[scanIndex].AcTableSelector; if (this.ah != 0) { @@ -630,7 +630,7 @@ namespace ImageSharp.Formats.Jpg /// The private int RefineNonZeroes(ref InputProcessor bp, int zig, int nz, int delta) { - var b = this.pointers.Block; + Block8x8F* b = this.pointers.Block; for (; zig <= this.zigEnd; zig++) { int u = this.pointers.Unzig[zig]; diff --git a/src/ImageSharp/IO/EndianBinaryWriter.cs b/src/ImageSharp/IO/EndianBinaryWriter.cs index 027c2b1f0..3b2028afd 100644 --- a/src/ImageSharp/IO/EndianBinaryWriter.cs +++ b/src/ImageSharp/IO/EndianBinaryWriter.cs @@ -52,7 +52,7 @@ namespace ImageSharp.IO /// public EndianBinaryWriter(Endianness endianness, Stream stream, Encoding encoding) { - var bitConverter = EndianBitConverter.GetConverter(endianness); + EndianBitConverter bitConverter = EndianBitConverter.GetConverter(endianness); // TODO: Use Guard if (bitConverter == null) diff --git a/src/ImageSharp/Image/Image{TColor}.cs b/src/ImageSharp/Image/Image{TColor}.cs index 27dee5434..4b22424da 100644 --- a/src/ImageSharp/Image/Image{TColor}.cs +++ b/src/ImageSharp/Image/Image{TColor}.cs @@ -168,7 +168,7 @@ namespace ImageSharp : base(configuration) { Guard.NotNull(filePath, nameof(filePath)); - using (var fs = File.OpenRead(filePath)) + using (FileStream fs = File.OpenRead(filePath)) { this.Load(fs, options); } diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs index a10417b90..3e60cae4d 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs @@ -28,7 +28,7 @@ namespace ImageSharp.Benchmarks { graphics.InterpolationMode = InterpolationMode.Default; graphics.SmoothingMode = SmoothingMode.AntiAlias; - var pen = new Pen(System.Drawing.Color.HotPink, 10); + Pen pen = new Pen(System.Drawing.Color.HotPink, 10); graphics.DrawBeziers(pen, new[] { new PointF(10, 500), new PointF(30, 10), diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs index 146def363..ee97866e2 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs @@ -28,7 +28,7 @@ namespace ImageSharp.Benchmarks { graphics.InterpolationMode = InterpolationMode.Default; graphics.SmoothingMode = SmoothingMode.AntiAlias; - var pen = new Pen(System.Drawing.Color.HotPink, 10); + Pen pen = new Pen(System.Drawing.Color.HotPink, 10); graphics.DrawLines(pen, new[] { new PointF(10, 10), new PointF(550, 50), diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs index e6c1ac0d6..047cacb42 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs @@ -27,7 +27,7 @@ namespace ImageSharp.Benchmarks { graphics.InterpolationMode = InterpolationMode.Default; graphics.SmoothingMode = SmoothingMode.AntiAlias; - var pen = new Pen(System.Drawing.Color.HotPink, 10); + Pen pen = new Pen(System.Drawing.Color.HotPink, 10); graphics.DrawPolygon(pen, new[] { new PointF(10, 10), new PointF(550, 50), diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs index 589ac0cd4..dcd22d6fb 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs @@ -25,7 +25,7 @@ namespace ImageSharp.Benchmarks using (Graphics graphics = Graphics.FromImage(destination)) { graphics.SmoothingMode = SmoothingMode.AntiAlias; - var brush = new HatchBrush(HatchStyle.BackwardDiagonal, System.Drawing.Color.HotPink); + HatchBrush brush = new HatchBrush(HatchStyle.BackwardDiagonal, System.Drawing.Color.HotPink); graphics.FillRectangle(brush, new Rectangle(0,0, 800,800)); // can't find a way to flood fill with a brush } using (MemoryStream ms = new MemoryStream()) diff --git a/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs b/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs index 26aad07b8..4fee634f5 100644 --- a/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs +++ b/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs @@ -104,13 +104,13 @@ namespace ImageSharp.Benchmarks.Image continue; } - var allFiles = + string[] allFiles = this.SearchPatterns.SelectMany( f => Directory.EnumerateFiles(path, f, SearchOption.AllDirectories) .Where(fn => !this.ExcludeSubstringsInFileNames.Any(w => fn.ToLower().Contains(w)))).ToArray(); - foreach (var fn in allFiles) + foreach (string fn in allFiles) { this.FileNamesToBytes[fn] = File.ReadAllBytes(fn); } @@ -123,13 +123,13 @@ namespace ImageSharp.Benchmarks.Image /// The operation to execute. If the returned object is <see cref="IDisposable"/> it will be disposed protected void ForEachStream(Func operation) { - foreach (var kv in this.FileNames2Bytes) + foreach (KeyValuePair kv in this.FileNames2Bytes) { using (MemoryStream memoryStream = new MemoryStream(kv.Value)) { try { - var obj = operation(memoryStream); + object obj = operation(memoryStream); (obj as IDisposable)?.Dispose(); } @@ -147,12 +147,12 @@ namespace ImageSharp.Benchmarks.Image { base.ReadFilesImpl(); - foreach (var kv in this.FileNamesToBytes) + foreach (KeyValuePair kv in this.FileNamesToBytes) { byte[] bytes = kv.Value; string fn = kv.Key; - using (var ms1 = new MemoryStream(bytes)) + using (MemoryStream ms1 = new MemoryStream(bytes)) { this.FileNamesToImageSharpImages[fn] = new Image(ms1); @@ -178,11 +178,11 @@ namespace ImageSharp.Benchmarks.Image protected void ForEachImageSharpImage(Func operation) { - foreach (var kv in this.FileNames2ImageSharpImages) + foreach (KeyValuePair kv in this.FileNames2ImageSharpImages) { try { - var obj = operation(kv.Value); + object obj = operation(kv.Value); (obj as IDisposable)?.Dispose(); } @@ -213,11 +213,11 @@ namespace ImageSharp.Benchmarks.Image protected void ForEachSystemDrawingImage(Func operation) { - foreach (var kv in this.FileNames2SystemDrawingImages) + foreach (KeyValuePair kv in this.FileNames2SystemDrawingImages) { try { - var obj = operation(kv.Value); + object obj = operation(kv.Value); (obj as IDisposable)?.Dispose(); } catch (Exception ex) diff --git a/tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs b/tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs index 6621292ec..fa950c4cf 100644 --- a/tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs @@ -368,7 +368,7 @@ namespace ImageSharp.Tests.Colors where TSource : struct where TDest : struct { - using (var buffers = new TestBuffers(source, expected)) + using (TestBuffers buffers = new TestBuffers(source, expected)) { action(buffers.Source, buffers.ActualDest); buffers.Verify(); diff --git a/tests/ImageSharp.Tests/Colors/ColorConstructorTests.cs b/tests/ImageSharp.Tests/Colors/ColorConstructorTests.cs index 08b9375f8..83c02635a 100644 --- a/tests/ImageSharp.Tests/Colors/ColorConstructorTests.cs +++ b/tests/ImageSharp.Tests/Colors/ColorConstructorTests.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector4Values = new Vector4[] + Vector4[] vector4Values = new Vector4[] { Vector4.Zero, Vector4.One, @@ -25,10 +25,10 @@ namespace ImageSharp.Tests.Colors Vector4.UnitW, }; - foreach (var vector4 in vector4Values) + foreach (Vector4 vector4 in vector4Values) { // using float array to work around a bug in xunit corruptint the state of any Vector4 passed as MemberData - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(vector4), vector4Components }; yield return new object[] { new Bgra4444(vector4), vector4Components }; @@ -48,7 +48,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector3Values = new Dictionary() + Dictionary vector3Values = new Dictionary() { { Vector3.One, Vector4.One }, { Vector3.Zero, new Vector4(0, 0, 0, 1) }, @@ -57,11 +57,11 @@ namespace ImageSharp.Tests.Colors { Vector3.UnitZ, new Vector4(0, 0, 1, 1) }, }; - foreach (var vector3 in vector3Values.Keys) + foreach (Vector3 vector3 in vector3Values.Keys) { - var vector4 = vector3Values[vector3]; + Vector4 vector4 = vector3Values[vector3]; // using float array to work around a bug in xunit corruptint the state of any Vector4 passed as MemberData - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(vector3), vector4Components }; yield return new object[] { new Bgr565(vector3), vector4Components }; @@ -73,7 +73,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector4Values = new Vector4[] + Vector4[] vector4Values = new Vector4[] { Vector4.Zero, Vector4.One, @@ -83,10 +83,10 @@ namespace ImageSharp.Tests.Colors Vector4.UnitW, }; - foreach (var vector4 in vector4Values) + foreach (Vector4 vector4 in vector4Values) { // using float array to work around a bug in xunit corruptint the state of any Vector4 passed as MemberData - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(vector4.X, vector4.Y, vector4.Z, vector4.W), vector4Components }; yield return new object[] { new Bgra4444(vector4.X, vector4.Y, vector4.Z, vector4.W), vector4Components }; @@ -106,7 +106,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector3Values = new Dictionary() + Dictionary vector3Values = new Dictionary() { { Vector3.One, Vector4.One }, { Vector3.Zero, new Vector4(0, 0, 0, 1) }, @@ -115,11 +115,11 @@ namespace ImageSharp.Tests.Colors { Vector3.UnitZ, new Vector4(0, 0, 1, 1) }, }; - foreach (var vector3 in vector3Values.Keys) + foreach (Vector3 vector3 in vector3Values.Keys) { - var vector4 = vector3Values[vector3]; + Vector4 vector4 = vector3Values[vector3]; // using float array to work around a bug in xunit corruptint the state of any Vector4 passed as MemberData - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(vector3.X, vector3.Y, vector3.Z), vector4Components }; yield return new object[] { new Bgr565(vector3.X, vector3.Y, vector3.Z), vector4Components }; @@ -135,12 +135,12 @@ namespace ImageSharp.Tests.Colors public void ConstructorToVector4(IPixel packedVector, float[] expectedVector4Components) { // Arrange - var precision = 2; + int precision = 2; // using float array to work around a bug in xunit corruptint the state of any Vector4 passed as MemberData - var expectedVector4 = new Vector4(expectedVector4Components[0], expectedVector4Components[1], expectedVector4Components[2], expectedVector4Components[3]); + Vector4 expectedVector4 = new Vector4(expectedVector4Components[0], expectedVector4Components[1], expectedVector4Components[2], expectedVector4Components[3]); // Act - var vector4 = packedVector.ToVector4(); + Vector4 vector4 = packedVector.ToVector4(); // Assert Assert.Equal(expectedVector4.X, vector4.X, precision); diff --git a/tests/ImageSharp.Tests/Colors/ColorEqualityTests.cs b/tests/ImageSharp.Tests/Colors/ColorEqualityTests.cs index c241e8d6f..b5b09c828 100644 --- a/tests/ImageSharp.Tests/Colors/ColorEqualityTests.cs +++ b/tests/ImageSharp.Tests/Colors/ColorEqualityTests.cs @@ -238,7 +238,7 @@ namespace ImageSharp.Tests.Colors public void Equality(object first, object second, Type type) { // Act - var equal = first.Equals(second); + bool equal = first.Equals(second); // Assert Assert.True(equal); @@ -254,7 +254,7 @@ namespace ImageSharp.Tests.Colors public void NotEquality(object first, object second, Type type) { // Act - var equal = first.Equals(second); + bool equal = first.Equals(second); // Assert Assert.False(equal); @@ -266,7 +266,7 @@ namespace ImageSharp.Tests.Colors public void HashCodeEqual(object first, object second, Type type) { // Act - var equal = first.GetHashCode() == second.GetHashCode(); + bool equal = first.GetHashCode() == second.GetHashCode(); // Assert Assert.True(equal); @@ -278,7 +278,7 @@ namespace ImageSharp.Tests.Colors public void HashCodeNotEqual(object first, object second, Type type) { // Act - var equal = first.GetHashCode() == second.GetHashCode(); + bool equal = first.GetHashCode() == second.GetHashCode(); // Assert Assert.False(equal); @@ -297,7 +297,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var equal = firstObject.Equals(secondObject); + dynamic equal = firstObject.Equals(secondObject); // Assert Assert.True(equal); @@ -316,7 +316,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var equal = firstObject.Equals(secondObject); + dynamic equal = firstObject.Equals(secondObject); // Assert Assert.False(equal); @@ -335,7 +335,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var equal = firstObject == secondObject; + dynamic equal = firstObject == secondObject; // Assert Assert.True(equal); @@ -354,7 +354,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var notEqual = firstObject != secondObject; + dynamic notEqual = firstObject != secondObject; // Assert Assert.True(notEqual); @@ -372,7 +372,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var almostEqual = firstObject.AlmostEquals(secondObject, precision); + dynamic almostEqual = firstObject.AlmostEquals(secondObject, precision); // Assert Assert.True(almostEqual); @@ -390,7 +390,7 @@ namespace ImageSharp.Tests.Colors dynamic secondObject = Convert.ChangeType(second, type); // Act - var almostEqual = firstObject.AlmostEquals(secondObject, precision); + dynamic almostEqual = firstObject.AlmostEquals(secondObject, precision); // Assert Assert.False(almostEqual); diff --git a/tests/ImageSharp.Tests/Colors/ColorPackingTests.cs b/tests/ImageSharp.Tests/Colors/ColorPackingTests.cs index ac5f8d6b4..7b743e53a 100644 --- a/tests/ImageSharp.Tests/Colors/ColorPackingTests.cs +++ b/tests/ImageSharp.Tests/Colors/ColorPackingTests.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector4Values = new Vector4[] + Vector4[] vector4Values = new Vector4[] { Vector4.Zero, Vector4.One, @@ -25,9 +25,9 @@ namespace ImageSharp.Tests.Colors Vector4.UnitW, }; - foreach (var vector4 in vector4Values) + foreach (Vector4 vector4 in vector4Values) { - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(), vector4Components }; yield return new object[] { new Bgra4444(), vector4Components }; @@ -47,7 +47,7 @@ namespace ImageSharp.Tests.Colors { get { - var vector4Values = new Vector4[] + Vector4[] vector4Values = new Vector4[] { Vector4.One, new Vector4(0, 0, 0, 1), @@ -56,9 +56,9 @@ namespace ImageSharp.Tests.Colors new Vector4(0, 0, 1, 1), }; - foreach (var vector4 in vector4Values) + foreach (Vector4 vector4 in vector4Values) { - var vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; + float[] vector4Components = new float[] { vector4.X, vector4.Y, vector4.Z, vector4.W }; yield return new object[] { new Argb(), vector4Components }; yield return new object[] { new Bgr565(), vector4Components }; @@ -72,12 +72,12 @@ namespace ImageSharp.Tests.Colors public void FromVector4ToVector4(IPixel packedVector, float[] vector4ComponentsToPack) { // Arrange - var precision = 2; - var vector4ToPack = new Vector4(vector4ComponentsToPack[0], vector4ComponentsToPack[1], vector4ComponentsToPack[2], vector4ComponentsToPack[3]); + int precision = 2; + Vector4 vector4ToPack = new Vector4(vector4ComponentsToPack[0], vector4ComponentsToPack[1], vector4ComponentsToPack[2], vector4ComponentsToPack[3]); packedVector.PackFromVector4(vector4ToPack); // Act - var vector4 = packedVector.ToVector4(); + Vector4 vector4 = packedVector.ToVector4(); // Assert Assert.Equal(vector4ToPack.X, vector4.X, precision); diff --git a/tests/ImageSharp.Tests/Common/PinnedBufferTests.cs b/tests/ImageSharp.Tests/Common/PinnedBufferTests.cs index 3688763b9..26b529f6a 100644 --- a/tests/ImageSharp.Tests/Common/PinnedBufferTests.cs +++ b/tests/ImageSharp.Tests/Common/PinnedBufferTests.cs @@ -78,7 +78,7 @@ using (PinnedBuffer buffer = new PinnedBuffer(a)) { - var arrayPtr = buffer.Slice(); + BufferPointer arrayPtr = buffer.Slice(); Assert.Equal(a, arrayPtr.Array); Assert.Equal(0, arrayPtr.Offset); diff --git a/tests/ImageSharp.Tests/ConfigurationTests.cs b/tests/ImageSharp.Tests/ConfigurationTests.cs index 883d23567..4f48c1323 100644 --- a/tests/ImageSharp.Tests/ConfigurationTests.cs +++ b/tests/ImageSharp.Tests/ConfigurationTests.cs @@ -21,7 +21,7 @@ namespace ImageSharp.Tests [Fact] public void IfAutoloadWellknwonFormatesIsTrueAllFormateAreLoaded() { - var configuration = Configuration.CreateDefaultInstance(); + Configuration configuration = Configuration.CreateDefaultInstance(); Assert.Equal(4, configuration.ImageFormats.Count); } diff --git a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs index 6153cb310..d7a4bde95 100644 --- a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs @@ -21,12 +21,12 @@ namespace ImageSharp.Tests.Drawing { string path = this.CreateOutputDirectory("Drawing", "LineComplexPolygon"); - var simplePath = new Polygon(new LinearLineSegment( + Polygon simplePath = new Polygon(new LinearLineSegment( new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300))); - var hole1 = new Polygon(new LinearLineSegment( + Polygon hole1 = new Polygon(new LinearLineSegment( new Vector2(37, 85), new Vector2(93, 85), new Vector2(65, 137))); diff --git a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs index cd3182d6c..ce13d9f0f 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs @@ -28,7 +28,7 @@ namespace ImageSharp.Tests.Drawing new Vector2(37, 85), new Vector2(93, 85), new Vector2(65, 137))); - var clipped = simplePath.Clip(hole1); + IPath clipped = simplePath.Clip(hole1); // var clipped = new Rectangle(10, 10, 100, 100).Clip(new Rectangle(20, 0, 20, 20)); using (Image image = new Image(500, 500)) { diff --git a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs index 9c6c6d234..54c4af38b 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs @@ -209,7 +209,7 @@ namespace ImageSharp.Tests.Drawing { string path = this.CreateOutputDirectory("Drawing", "FilledPolygons"); - var config = Configuration.CreateDefaultInstance(); + Configuration config = Configuration.CreateDefaultInstance(); config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(100, 100, config)) { @@ -228,7 +228,7 @@ namespace ImageSharp.Tests.Drawing { string path = this.CreateOutputDirectory("Drawing", "FilledPolygons"); - var config = Configuration.CreateDefaultInstance(); + Configuration config = Configuration.CreateDefaultInstance(); config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(100, 100, config)) { @@ -248,7 +248,7 @@ namespace ImageSharp.Tests.Drawing { string path = this.CreateOutputDirectory("Drawing", "FilledPolygons"); - var config = Configuration.CreateDefaultInstance(); + Configuration config = Configuration.CreateDefaultInstance(); config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(200, 200, config)) { diff --git a/tests/ImageSharp.Tests/Drawing/Text/GlyphBuilder.cs b/tests/ImageSharp.Tests/Drawing/Text/GlyphBuilder.cs index 1faa5edd3..c7121695e 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/GlyphBuilder.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/GlyphBuilder.cs @@ -16,7 +16,7 @@ namespace ImageSharp.Tests.Drawing.Text public void OriginUsed() { // Y axis is inverted as it expects to be drawing for bottom left - var fullBuilder = new GlyphBuilder(new System.Numerics.Vector2(10, 99)); + GlyphBuilder fullBuilder = new GlyphBuilder(new System.Numerics.Vector2(10, 99)); IGlyphRenderer builder = fullBuilder; builder.BeginGlyph(); @@ -36,7 +36,7 @@ namespace ImageSharp.Tests.Drawing.Text builder.EndFigure(); builder.EndGlyph(); - var points = fullBuilder.Paths.Single().Flatten().Single().Points; + System.Collections.Immutable.ImmutableArray points = fullBuilder.Paths.Single().Flatten().Single().Points; Assert.Contains(new Vector2(10, 99), points); Assert.Contains(new Vector2(10, 109), points); @@ -50,7 +50,7 @@ namespace ImageSharp.Tests.Drawing.Text // Y axis is inverted as it expects to be drawing for bottom left GlyphBuilder fullBuilder = new GlyphBuilder(); IGlyphRenderer builder = fullBuilder; - for (var i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) { builder.BeginGlyph(); builder.BeginFigure(); diff --git a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs index ae007727a..0bb3afccd 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs @@ -30,7 +30,7 @@ namespace ImageSharp.Tests.Drawing.Text public void DrawAB() { //draws 2 overlapping triangle glyphs twice 1 set on each line - using (var img = new Image(100, 200)) + using (Image img = new Image(100, 200)) { img.Fill(Color.DarkBlue) .DrawText("AB\nAB", new Font(this.Font, 50), Color.Red, new Vector2(0, 0)); diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index b874a1585..5dac59d69 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsFalse_CommentsAreRead() { - var options = new DecoderOptions() + DecoderOptions options = new DecoderOptions() { IgnoreMetadata = false }; @@ -33,7 +33,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsTrue_CommentsAreIgnored() { - var options = new DecoderOptions() + DecoderOptions options = new DecoderOptions() { IgnoreMetadata = true }; @@ -49,7 +49,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_TextEncodingSetToUnicode_TextIsReadWithCorrectEncoding() { - var options = new GifDecoderOptions() + GifDecoderOptions options = new GifDecoderOptions() { TextEncoding = Encoding.Unicode }; diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs index da1323627..a140b7a3c 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Tests [Fact] public void Encode_IgnoreMetadataIsFalse_CommentsAreWritten() { - var options = new EncoderOptions() + EncoderOptions options = new EncoderOptions() { IgnoreMetadata = false }; @@ -42,7 +42,7 @@ namespace ImageSharp.Tests [Fact] public void Encode_IgnoreMetadataIsTrue_CommentsAreNotWritten() { - var options = new GifEncoderOptions() + GifEncoderOptions options = new GifEncoderOptions() { IgnoreMetadata = true }; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs index cd863ebf9..63ddbc884 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs @@ -278,7 +278,7 @@ namespace ImageSharp.Tests [InlineData(3)] public void TransformIDCT(int seed) { - var sourceArray = Create8x8RandomFloatData(-200, 200, seed); + MutableSpan sourceArray = Create8x8RandomFloatData(-200, 200, seed); float[] expectedDestArray = new float[64]; float[] tempArray = new float[64]; @@ -306,7 +306,7 @@ namespace ImageSharp.Tests [Fact] public unsafe void CopyColorsTo() { - var data = Create8x8FloatData(); + float[] data = Create8x8FloatData(); Block8x8F block = new Block8x8F(); block.LoadFrom(data); block.MultiplyAllInplace(new Vector4(5, 5, 5, 5)); @@ -348,7 +348,7 @@ namespace ImageSharp.Tests public void TransformByteConvetibleColorValuesInto() { Block8x8F block = new Block8x8F(); - var input = Create8x8ColorCropTestData(); + float[] input = Create8x8ColorCropTestData(); block.LoadFrom(input); this.Output.WriteLine("Input:"); this.PrintLinearData(input); @@ -371,18 +371,18 @@ namespace ImageSharp.Tests [InlineData(2)] public void FDCT8x4_LeftPart(int seed) { - var src = Create8x8RandomFloatData(-200, 200, seed); - var srcBlock = new Block8x8F(); + MutableSpan src = Create8x8RandomFloatData(-200, 200, seed); + Block8x8F srcBlock = new Block8x8F(); srcBlock.LoadFrom(src); - var destBlock = new Block8x8F(); + Block8x8F destBlock = new Block8x8F(); - var expectedDest = new MutableSpan(64); + MutableSpan expectedDest = new MutableSpan(64); ReferenceImplementations.fDCT2D8x4_32f(src, expectedDest); DCT.FDCT8x4_LeftPart(ref srcBlock, ref destBlock); - var actualDest = new MutableSpan(64); + MutableSpan actualDest = new MutableSpan(64); destBlock.CopyTo(actualDest); Assert.Equal(actualDest.Data, expectedDest.Data, new ApproximateFloatComparer(1f)); @@ -393,18 +393,18 @@ namespace ImageSharp.Tests [InlineData(2)] public void FDCT8x4_RightPart(int seed) { - var src = Create8x8RandomFloatData(-200, 200, seed); - var srcBlock = new Block8x8F(); + MutableSpan src = Create8x8RandomFloatData(-200, 200, seed); + Block8x8F srcBlock = new Block8x8F(); srcBlock.LoadFrom(src); - var destBlock = new Block8x8F(); + Block8x8F destBlock = new Block8x8F(); - var expectedDest = new MutableSpan(64); + MutableSpan expectedDest = new MutableSpan(64); ReferenceImplementations.fDCT2D8x4_32f(src.Slice(4), expectedDest.Slice(4)); DCT.FDCT8x4_RightPart(ref srcBlock, ref destBlock); - var actualDest = new MutableSpan(64); + MutableSpan actualDest = new MutableSpan(64); destBlock.CopyTo(actualDest); Assert.Equal(actualDest.Data, expectedDest.Data, new ApproximateFloatComparer(1f)); @@ -415,20 +415,20 @@ namespace ImageSharp.Tests [InlineData(2)] public void TransformFDCT(int seed) { - var src = Create8x8RandomFloatData(-200, 200, seed); - var srcBlock = new Block8x8F(); + MutableSpan src = Create8x8RandomFloatData(-200, 200, seed); + Block8x8F srcBlock = new Block8x8F(); srcBlock.LoadFrom(src); - var destBlock = new Block8x8F(); + Block8x8F destBlock = new Block8x8F(); - var expectedDest = new MutableSpan(64); - var temp1 = new MutableSpan(64); - var temp2 = new Block8x8F(); + MutableSpan expectedDest = new MutableSpan(64); + MutableSpan temp1 = new MutableSpan(64); + Block8x8F temp2 = new Block8x8F(); ReferenceImplementations.fDCT2D_llm(src, expectedDest, temp1, downscaleBy8: true); DCT.TransformFDCT(ref srcBlock, ref destBlock, ref temp2, false); - var actualDest = new MutableSpan(64); + MutableSpan actualDest = new MutableSpan(64); destBlock.CopyTo(actualDest); Assert.Equal(actualDest.Data, expectedDest.Data, new ApproximateFloatComparer(1f)); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index 7cb9a7cf2..5723f9b23 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -125,7 +125,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsFalse_ExifProfileIsRead() { - var options = new DecoderOptions() + DecoderOptions options = new DecoderOptions() { IgnoreMetadata = false }; @@ -141,7 +141,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsTrue_ExifProfileIgnored() { - var options = new DecoderOptions() + DecoderOptions options = new DecoderOptions() { IgnoreMetadata = true }; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs index 741e785c0..c97eb1461 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs @@ -74,7 +74,7 @@ namespace ImageSharp.Tests [Fact] public void Encode_IgnoreMetadataIsFalse_ExifProfileIsWritten() { - var options = new EncoderOptions() + EncoderOptions options = new EncoderOptions() { IgnoreMetadata = false }; @@ -99,7 +99,7 @@ namespace ImageSharp.Tests [Fact] public void Encode_IgnoreMetadataIsTrue_ExifProfileIgnored() { - var options = new JpegEncoderOptions() + JpegEncoderOptions options = new JpegEncoderOptions() { IgnoreMetadata = true }; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs index 589317a36..50b94bc24 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs @@ -52,7 +52,7 @@ namespace ImageSharp.Tests.Formats.Jpg { MutableSpan original = Create8x8RandomIntData(-200, 200, seed); - var block = original.AddScalarToAllValues(128); + MutableSpan block = original.AddScalarToAllValues(128); ReferenceImplementations.IntegerReferenceDCT.TransformFDCTInplace(block); @@ -79,7 +79,7 @@ namespace ImageSharp.Tests.Formats.Jpg [InlineData(2, 0)] public void FloatingPointDCT_ReferenceImplementation_ForwardThenInverse(int seed, int startAt) { - var data = Create8x8RandomIntData(-200, 200, seed); + int[] data = Create8x8RandomIntData(-200, 200, seed); MutableSpan src = new MutableSpan(data).ConvertToFloat32MutableSpan(); MutableSpan dest = new MutableSpan(64); MutableSpan temp = new MutableSpan(64); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs index 8e228141d..ee38f500b 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs @@ -55,7 +55,7 @@ namespace ImageSharp.Tests this.Output.WriteLine($"RATIO: {ratio}"); - var img = new YCbCrImage(400, 400, ratio); + YCbCrImage img = new YCbCrImage(400, 400, ratio); //this.PrintChannel("Y", img.YChannel); //this.PrintChannel("Cb", img.CbChannel); diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs index 921530806..e03d42c9a 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsFalse_TextChunckIsRead() { - var options = new PngDecoderOptions() + PngDecoderOptions options = new PngDecoderOptions() { IgnoreMetadata = false }; @@ -33,7 +33,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_IgnoreMetadataIsTrue_TextChunksAreIgnored() { - var options = new PngDecoderOptions() + PngDecoderOptions options = new PngDecoderOptions() { IgnoreMetadata = true }; @@ -49,7 +49,7 @@ namespace ImageSharp.Tests [Fact] public void Decode_TextEncodingSetToUnicode_TextIsReadWithCorrectEncoding() { - var options = new PngDecoderOptions() + PngDecoderOptions options = new PngDecoderOptions() { TextEncoding = Encoding.Unicode }; diff --git a/tests/ImageSharp.Tests/Image/ImageTests.cs b/tests/ImageSharp.Tests/Image/ImageTests.cs index 0ed724fad..b0a031a78 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.cs @@ -67,14 +67,14 @@ namespace ImageSharp.Tests public void Save_DetecedEncoding() { string file = TestFile.GetPath("../../TestOutput/Save_DetecedEncoding.png"); - var dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); + System.IO.DirectoryInfo dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); using (Image image = new Image(10, 10)) { image.Save(file); } - var c = TestFile.Create("../../TestOutput/Save_DetecedEncoding.png"); - using (var img = c.CreateImage()) + TestFile c = TestFile.Create("../../TestOutput/Save_DetecedEncoding.png"); + using (Image img = c.CreateImage()) { Assert.IsType(img.CurrentImageFormat); } @@ -84,7 +84,7 @@ namespace ImageSharp.Tests public void Save_UnknownExtensionsEncoding() { string file = TestFile.GetPath("../../TestOutput/Save_DetecedEncoding.tmp"); - var ex = Assert.Throws( + InvalidOperationException ex = Assert.Throws( () => { using (Image image = new Image(10, 10)) @@ -98,14 +98,14 @@ namespace ImageSharp.Tests public void Save_SetFormat() { string file = TestFile.GetPath("../../TestOutput/Save_SetFormat.dat"); - var dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); + System.IO.DirectoryInfo dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); using (Image image = new Image(10, 10)) { image.Save(file, new PngFormat()); } - var c = TestFile.Create("../../TestOutput/Save_SetFormat.dat"); - using (var img = c.CreateImage()) + TestFile c = TestFile.Create("../../TestOutput/Save_SetFormat.dat"); + using (Image img = c.CreateImage()) { Assert.IsType(img.CurrentImageFormat); } @@ -115,14 +115,14 @@ namespace ImageSharp.Tests public void Save_SetEncoding() { string file = TestFile.GetPath("../../TestOutput/Save_SetEncoding.dat"); - var dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); + System.IO.DirectoryInfo dir = System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(file)); using (Image image = new Image(10, 10)) { image.Save(file, new PngEncoder()); } - var c = TestFile.Create("../../TestOutput/Save_SetEncoding.dat"); - using (var img = c.CreateImage()) + TestFile c = TestFile.Create("../../TestOutput/Save_SetEncoding.dat"); + using (Image img = c.CreateImage()) { Assert.IsType(img.CurrentImageFormat); } diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs index 8ec57057f..785d9dcfc 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs @@ -243,7 +243,7 @@ namespace ImageSharp.Tests TestProfile(profile); - var thumbnail = profile.CreateThumbnail(); + Image thumbnail = profile.CreateThumbnail(); Assert.NotNull(thumbnail); Assert.Equal(256, thumbnail.Width); Assert.Equal(170, thumbnail.Height); diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs index daad49b2c..1d36de5ef 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs @@ -12,7 +12,7 @@ namespace ImageSharp.Tests [Fact] public void TestExifTag() { - var exifProfile = new ExifProfile(); + ExifProfile exifProfile = new ExifProfile(); exifProfile.SetValue(ExifTag.ResolutionUnit, (ushort)1); ExifValue value = exifProfile.GetValue(ExifTag.ResolutionUnit); diff --git a/tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs b/tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs index 06ab245c9..643033f4c 100644 --- a/tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs @@ -64,8 +64,8 @@ namespace ImageSharp.Tests using (Image image = file.CreateImage()) using (FileStream output = File.OpenWrite($"{path}/{filename}")) { - var sourceRectangle = new Rectangle(image.Width / 8, image.Height / 8, image.Width / 4, image.Height / 4); - var destRectangle = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); + Rectangle sourceRectangle = new Rectangle(image.Width / 8, image.Height / 8, image.Width / 4, image.Height / 4); + Rectangle destRectangle = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); image.Resize(image.Width, image.Height, sampler, sourceRectangle, destRectangle, false).Save(output); } } diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index 42340dc44..939b1254e 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -165,7 +165,7 @@ namespace ImageSharp.Tests AddFormatsDirectoryFromTestAssebmlyPath(directories); - var directory = directories.FirstOrDefault(x => Directory.Exists(x)); + string directory = directories.FirstOrDefault(x => Directory.Exists(x)); if(directory != null) { diff --git a/tests/ImageSharp.Tests/TestFont.cs b/tests/ImageSharp.Tests/TestFont.cs index 3a5bb2b2c..e7ef63b89 100644 --- a/tests/ImageSharp.Tests/TestFont.cs +++ b/tests/ImageSharp.Tests/TestFont.cs @@ -58,7 +58,7 @@ namespace ImageSharp.Tests AddFormatsDirectoryFromTestAssebmlyPath(directories); - var directory = directories.FirstOrDefault(x => Directory.Exists(x)); + string directory = directories.FirstOrDefault(x => Directory.Exists(x)); if(directory != null) { diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs index 4d18da025..206393e27 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs @@ -29,25 +29,25 @@ namespace ImageSharp.Tests public override IEnumerable GetData(MethodInfo testMethod) { - var type = testMethod.GetParameters().First().ParameterType.GetTypeInfo(); + TypeInfo type = testMethod.GetParameters().First().ParameterType.GetTypeInfo(); if (!type.IsGenericType || type.GetGenericTypeDefinition() != typeof(TestImageProvider<>)) { yield return this.AdditionalParameters; } else { - foreach (var kv in this.PixelTypes.ExpandAllTypes()) + foreach (KeyValuePair kv in this.PixelTypes.ExpandAllTypes()) { - var factoryType = typeof(TestImageProvider<>).MakeGenericType(kv.Value); + Type factoryType = typeof(TestImageProvider<>).MakeGenericType(kv.Value); foreach (object[] originalFacoryMethodArgs in this.GetAllFactoryMethodArgs(testMethod, factoryType)) { - var actualFactoryMethodArgs = new object[originalFacoryMethodArgs.Length + 2]; + object[] actualFactoryMethodArgs = new object[originalFacoryMethodArgs.Length + 2]; Array.Copy(originalFacoryMethodArgs, actualFactoryMethodArgs, originalFacoryMethodArgs.Length); actualFactoryMethodArgs[actualFactoryMethodArgs.Length - 2] = testMethod; actualFactoryMethodArgs[actualFactoryMethodArgs.Length - 1] = kv.Key; - var factory = factoryType.GetMethod(this.GetFactoryMethodName(testMethod)) + object factory = factoryType.GetMethod(this.GetFactoryMethodName(testMethod)) .Invoke(null, actualFactoryMethodArgs); object[] result = new object[this.AdditionalParameters.Length + 1]; @@ -61,7 +61,7 @@ namespace ImageSharp.Tests protected virtual IEnumerable GetAllFactoryMethodArgs(MethodInfo testMethod, Type factoryType) { - var args = this.GetFactoryMethodArgs(testMethod, factoryType); + object[] args = this.GetFactoryMethodArgs(testMethod, factoryType); return Enumerable.Repeat(args, 1); } diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs index c75cf71bf..be0fa7b3f 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs @@ -36,7 +36,7 @@ namespace ImageSharp.Tests protected override IEnumerable GetAllFactoryMethodArgs(MethodInfo testMethod, Type factoryType) { - var accessor = this.GetPropertyAccessor(testMethod.DeclaringType); + Func accessor = this.GetPropertyAccessor(testMethod.DeclaringType); accessor = accessor ?? this.GetFieldAccessor(testMethod.DeclaringType); @@ -52,7 +52,7 @@ namespace ImageSharp.Tests private Func GetFieldAccessor(Type type) { FieldInfo fieldInfo = null; - for (var reflectionType = type; + for (Type reflectionType = type; reflectionType != null; reflectionType = reflectionType.GetTypeInfo().BaseType) { @@ -71,7 +71,7 @@ namespace ImageSharp.Tests private Func GetPropertyAccessor(Type type) { PropertyInfo propInfo = null; - for (var reflectionType = type; + for (Type reflectionType = type; reflectionType != null; reflectionType = reflectionType.GetTypeInfo().BaseType) { diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs index e658e817d..fa5e57dd0 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs @@ -33,19 +33,19 @@ namespace ImageSharp.Tests protected override object[] GetFactoryMethodArgs(MethodInfo testMethod, Type factoryType) { - var m = testMethod.DeclaringType.GetMethod(this.memberMethodName); + MethodInfo m = testMethod.DeclaringType.GetMethod(this.memberMethodName); - var args = factoryType.GetGenericArguments(); - var colorType = args.Single(); + Type[] args = factoryType.GetGenericArguments(); + Type colorType = args.Single(); - var imgType = typeof(Image<>).MakeGenericType(colorType); - var genericFactoryType = (typeof(GenericFactory<>)).MakeGenericType(colorType); + Type imgType = typeof(Image<>).MakeGenericType(colorType); + Type genericFactoryType = (typeof(GenericFactory<>)).MakeGenericType(colorType); - var funcType = typeof(Func<,>).MakeGenericType(genericFactoryType, imgType); + Type funcType = typeof(Func<,>).MakeGenericType(genericFactoryType, imgType); - var genericMethod = m.MakeGenericMethod(args); + MethodInfo genericMethod = m.MakeGenericMethod(args); - var d = genericMethod.CreateDelegate(funcType); + Delegate d = genericMethod.CreateDelegate(funcType); return new object[] { d }; } diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs index cd403caed..7975f9b7e 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs @@ -37,13 +37,13 @@ namespace ImageSharp.Tests public override Image GetImage() { - var key = new Key(this.PixelType, this.filePath); + Key key = new Key(this.PixelType, this.filePath); - var cachedImage = cache.GetOrAdd( + Image cachedImage = cache.GetOrAdd( key, fn => { - var testFile = TestFile.Create(this.filePath); + TestFile testFile = TestFile.Create(this.filePath); return this.Factory.CreateImage(testFile.Bytes); }); diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs index 855374f55..1593014ae 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs @@ -38,7 +38,7 @@ namespace ImageSharp.Tests public override Image GetImage() { - var image = base.GetImage(); + Image image = base.GetImage(); TColor color = default(TColor); color.PackFromBytes(this.r, this.g, this.b, this.a); diff --git a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs index 38429b278..bcccd1b44 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs @@ -81,11 +81,11 @@ namespace ImageSharp.Tests { string path = this.GetTestOutputFileName(extension); - var format = GetImageFormatByExtension(extension); + IImageFormat format = GetImageFormatByExtension(extension); encoder = encoder ?? format.Encoder; - using (var stream = File.OpenWrite(path)) + using (FileStream stream = File.OpenWrite(path)) { image.Save(stream, encoder, options); } diff --git a/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs b/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs index ca3340238..260a677d3 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs @@ -33,7 +33,7 @@ namespace ImageSharp.Tests foreach (PixelTypes pt in AllConcretePixelTypes.Where(pt => pt != PixelTypes.StandardImageClass)) { string typeName = $"{nameSpace}.{pt.ToString()}"; - var t = ImageSharpAssembly.GetType(typeName); + Type t = ImageSharpAssembly.GetType(typeName); if (t == null) { throw new InvalidOperationException($"Could not find: {typeName}"); @@ -58,16 +58,16 @@ namespace ImageSharp.Tests byte[] bytesA = new byte[3]; byte[] bytesB = new byte[3]; - using (var pixA = a.Lock()) + using (PixelAccessor pixA = a.Lock()) { - using (var pixB = b.Lock()) + using (PixelAccessor pixB = b.Lock()) { for (int y = 0; y < a.Height; y++) { for (int x = 0; x < a.Width; x++) { - var ca = pixA[x, y]; - var cb = pixB[x, y]; + TColor ca = pixA[x, y]; + TColor cb = pixB[x, y]; if (compareAlpha) { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 1acb9e149..6760735d1 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -24,7 +24,7 @@ namespace ImageSharp.Tests public void Use_WithEmptyImageAttribute(TestImageProvider provider, string message) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.Equal(42, img.Width); Assert.Equal(666, img.Height); @@ -38,7 +38,7 @@ namespace ImageSharp.Tests string message) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.Equal(42, img.Width); Assert.Equal(666, img.Height); @@ -62,7 +62,7 @@ namespace ImageSharp.Tests TestImageProvider provider) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.IsType(img); } @@ -74,7 +74,7 @@ namespace ImageSharp.Tests where TColor : struct, IPixel { Assert.NotNull(provider.Utility.SourceFileOrDescription); - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.True(img.Width * img.Height > 0); Assert.Equal(88, yo); @@ -91,7 +91,7 @@ namespace ImageSharp.Tests where TColor : struct, IPixel { Assert.NotNull(provider.Utility.SourceFileOrDescription); - var image = provider.GetImage(); + Image image = provider.GetImage(); provider.Utility.SaveTestOutputFile(image, "png"); } @@ -100,13 +100,13 @@ namespace ImageSharp.Tests public void Use_WithSolidFilledImagesAttribute(TestImageProvider provider) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.Equal(img.Width, 10); Assert.Equal(img.Height, 20); byte[] colors = new byte[4]; - using (var pixels = img.Lock()) + using (PixelAccessor pixels = img.Lock()) { for (int y = 0; y < pixels.Height; y++) { @@ -140,7 +140,7 @@ namespace ImageSharp.Tests public void Use_WithMemberFactoryAttribute(TestImageProvider provider) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.Equal(img.Width, 3); if (provider.PixelType == PixelTypes.StandardImageClass) { @@ -162,7 +162,7 @@ namespace ImageSharp.Tests public void Blank_MemberData(TestImageProvider provider) where TColor : struct, IPixel { - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.True(img.Width * img.Height > 0); } @@ -183,7 +183,7 @@ namespace ImageSharp.Tests this.Output.WriteLine("SRC: " + provider.Utility.SourceFileOrDescription); this.Output.WriteLine("OUT: " + provider.Utility.GetTestOutputFileName()); - var img = provider.GetImage(); + Image img = provider.GetImage(); Assert.True(img.Width * img.Height > 0); } diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs index 1db209dcd..63c24a157 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs @@ -28,7 +28,7 @@ namespace ImageSharp.Tests { Image image = factory.CreateImage(10, 10); - using (var pixels = image.Lock()) + using (PixelAccessor pixels = image.Lock()) { for (int i = 0; i < 10; i++) { @@ -51,10 +51,10 @@ namespace ImageSharp.Tests [Fact] public void Baz() { - var type = typeof(Color).GetTypeInfo().Assembly.GetType("ImageSharp.Color"); + Type type = typeof(Color).GetTypeInfo().Assembly.GetType("ImageSharp.Color"); this.Output.WriteLine(type.ToString()); - var fake = typeof(Color).GetTypeInfo().Assembly.GetType("ImageSharp.dsaada_DASqewrr"); + Type fake = typeof(Color).GetTypeInfo().Assembly.GetType("ImageSharp.dsaada_DASqewrr"); Assert.Null(fake); } @@ -64,8 +64,8 @@ namespace ImageSharp.Tests public void IsEquivalentTo_WhenFalse(TestImageProvider provider, bool compareAlpha) where TColor : struct, IPixel { - var a = provider.GetImage(); - var b = provider.GetImage(); + Image a = provider.GetImage(); + Image b = provider.GetImage(); b = b.OilPaint(3, 2); Assert.False(a.IsEquivalentTo(b, compareAlpha)); @@ -77,8 +77,8 @@ namespace ImageSharp.Tests public void IsEquivalentTo_WhenTrue(TestImageProvider provider, bool compareAlpha) where TColor : struct, IPixel { - var a = provider.GetImage(); - var b = provider.GetImage(); + Image a = provider.GetImage(); + Image b = provider.GetImage(); Assert.True(a.IsEquivalentTo(b, compareAlpha)); } @@ -114,7 +114,7 @@ namespace ImageSharp.Tests { PixelTypes pixelTypes = PixelTypes.Alpha8 | PixelTypes.Bgr565 | PixelTypes.Color | PixelTypes.HalfVector2 | PixelTypes.StandardImageClass; - var expanded = pixelTypes.ExpandAllTypes(); + IEnumerable> expanded = pixelTypes.ExpandAllTypes(); Assert.Equal(expanded.Count(), 5); @@ -128,7 +128,7 @@ namespace ImageSharp.Tests [Fact] public void ToTypes_All() { - var expanded = PixelTypes.All.ExpandAllTypes().ToArray(); + KeyValuePair[] expanded = PixelTypes.All.ExpandAllTypes().ToArray(); Assert.True(expanded.Length >= TestUtilityExtensions.GetAllPixelTypes().Length - 2); AssertContainsPixelType(PixelTypes.Color, expanded);