зеркало из https://github.com/SixLabors/Shapes.git
update dependencies and fix xunit warnings
This commit is contained in:
Родитель
bfc79aee4c
Коммит
0004da8925
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="myget.org imagesharp-CI" value="https://www.myget.org/F/imagesharp/api/v3/index.json" />
|
||||
<add key="myget.org sixlabors-CI" value="https://www.myget.org/F/sixlabors/api/v3/index.json" />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
|
||||
</packageSources>
|
||||
|
|
|
@ -8,6 +8,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt
|
|||
.editorconfig = .editorconfig
|
||||
appveyor.yml = appveyor.yml
|
||||
build.cmd = build.cmd
|
||||
NuGet.config = NuGet.config
|
||||
README.md = README.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
|
@ -29,7 +30,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SixLabors.Shapes.Tests", "t
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrawShapesWithImageSharp", "samples\DrawShapesWithImageSharp\DrawShapesWithImageSharp.csproj", "{999EDFB3-9FE4-4E09-B669-CB02E597EC20}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SixLabors.Shapes.Benchmarks", "tests\SixLabors.Shapes.Benchmarks\SixLabors.Shapes.Benchmarks.csproj", "{87E262FA-57FE-4AA7-853C-9DD91E769D4B}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SixLabors.Shapes.Benchmarks", "tests\SixLabors.Shapes.Benchmarks\SixLabors.Shapes.Benchmarks.csproj", "{87E262FA-57FE-4AA7-853C-9DD91E769D4B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SixLabors.Shapes.Text", "src\SixLabors.Shapes.Text\SixLabors.Shapes.Text.csproj", "{32D7A12E-B392-42CE-8EFB-1B685680F5B8}"
|
||||
EndProject
|
||||
|
@ -71,6 +72,9 @@ Global
|
|||
{87E262FA-57FE-4AA7-853C-9DD91E769D4B} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
|
||||
{32D7A12E-B392-42CE-8EFB-1B685680F5B8} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A0074D4F-97D9-49A4-BE1F-35AFCEA40486}
|
||||
EndGlobalSection
|
||||
GlobalSection(Performance) = preSolution
|
||||
HasPerformanceSessions = true
|
||||
EndGlobalSection
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0003" />
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0-rc1" />
|
||||
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-dev001425" />
|
||||
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
|
||||
<PackageReference Include="System.Runtime.Numerics" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta0005" />
|
||||
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-dev000083" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0005" />
|
||||
<PackageReference Include="System.Buffers" Version="4.4.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.0-rc1" />
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -6,7 +6,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.10.9" />
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
PointF[] buffer = shape.FindIntersections(new PointF(0, 10), new PointF(10, 0)).ToArray();
|
||||
|
||||
Assert.Equal(1, buffer.Length);
|
||||
Assert.Single(buffer);
|
||||
Assert.Equal(new PointF(5, 5), buffer[0]);
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
PointF[] buffer = shape.FindIntersections(new PointF(0, 10), new PointF(10, 0)).ToArray();
|
||||
|
||||
Assert.Equal(0, buffer.Length);
|
||||
Assert.Empty(buffer);
|
||||
}
|
||||
[Fact]
|
||||
public void Intersections_Diagonal_and_straight_Hit()
|
||||
|
@ -235,7 +235,7 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
PointF[] buffer = shape.FindIntersections(new PointF(3, 10), new PointF(3, 0)).ToArray();
|
||||
|
||||
Assert.Equal(1, buffer.Length);
|
||||
Assert.Single(buffer);
|
||||
Assert.Equal(new PointF(3, 3), buffer[0]);
|
||||
}
|
||||
[Fact]
|
||||
|
@ -245,7 +245,7 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
PointF[] buffer = shape.FindIntersections(new PointF(3, 10), new PointF(3, 3.5f)).ToArray();
|
||||
|
||||
Assert.Equal(0, buffer.Length);
|
||||
Assert.Empty(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace SixLabors.Shapes.Tests
|
|||
IEnumerable<PointF> inter = p.FindIntersections(Vector2.One, Vector2.Zero);
|
||||
|
||||
// if simplified to single point then we should never have an intersection
|
||||
Assert.Equal(0, inter.Count());
|
||||
Assert.Empty(inter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ namespace SixLabors.Shapes.Tests
|
|||
public PathExtentionTests()
|
||||
{
|
||||
this.bounds = new RectangleF(10, 10, 20, 20);
|
||||
mockPath = new Mock<IPath>();
|
||||
mockPath.Setup(x => x.Bounds).Returns(() => bounds);
|
||||
this.mockPath = new Mock<IPath>();
|
||||
this.mockPath.Setup(x => x.Bounds).Returns(() => this.bounds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -26,20 +26,20 @@ namespace SixLabors.Shapes.Tests
|
|||
{
|
||||
float angle = (float)Math.PI;
|
||||
|
||||
mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
this.mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
.Callback<Matrix3x2>(m =>
|
||||
{
|
||||
//validate matrix in here
|
||||
|
||||
Matrix3x2 targetMatrix = Matrix3x2.CreateRotation(angle, RectangleF.Center(bounds));
|
||||
Matrix3x2 targetMatrix = Matrix3x2.CreateRotation(angle, RectangleF.Center(this.bounds));
|
||||
|
||||
Assert.Equal(targetMatrix, m);
|
||||
|
||||
}).Returns(mockPath.Object);
|
||||
}).Returns(this.mockPath.Object);
|
||||
|
||||
mockPath.Object.Rotate(angle);
|
||||
this.mockPath.Object.Rotate(angle);
|
||||
|
||||
mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
this.mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -47,21 +47,21 @@ namespace SixLabors.Shapes.Tests
|
|||
{
|
||||
float angle = 90;
|
||||
|
||||
mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
this.mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
.Callback<Matrix3x2>(m =>
|
||||
{
|
||||
//validate matrix in here
|
||||
float radians = (float)(Math.PI * angle / 180.0);
|
||||
|
||||
Matrix3x2 targetMatrix = Matrix3x2.CreateRotation(radians, RectangleF.Center(bounds));
|
||||
Matrix3x2 targetMatrix = Matrix3x2.CreateRotation(radians, RectangleF.Center(this.bounds));
|
||||
|
||||
Assert.Equal(targetMatrix, m);
|
||||
|
||||
}).Returns(mockPath.Object);
|
||||
}).Returns(this.mockPath.Object);
|
||||
|
||||
mockPath.Object.RotateDegree(angle);
|
||||
this.mockPath.Object.RotateDegree(angle);
|
||||
|
||||
mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
this.mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -69,7 +69,7 @@ namespace SixLabors.Shapes.Tests
|
|||
{
|
||||
Vector2 point = new Vector2(98, 120);
|
||||
|
||||
mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
this.mockPath.Setup(x => x.Transform(It.IsAny<Matrix3x2>()))
|
||||
.Callback<Matrix3x2>(m =>
|
||||
{
|
||||
//validate matrix in here
|
||||
|
@ -78,11 +78,11 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
Assert.Equal(targetMatrix, m);
|
||||
|
||||
}).Returns(mockPath.Object);
|
||||
}).Returns(this.mockPath.Object);
|
||||
|
||||
mockPath.Object.Translate(point);
|
||||
this.mockPath.Object.Translate(point);
|
||||
|
||||
mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
this.mockPath.Verify(x => x.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -91,7 +91,7 @@ namespace SixLabors.Shapes.Tests
|
|||
float x = 76;
|
||||
float y = 7;
|
||||
|
||||
mockPath.Setup(p => p.Transform(It.IsAny<Matrix3x2>()))
|
||||
this.mockPath.Setup(p => p.Transform(It.IsAny<Matrix3x2>()))
|
||||
.Callback<Matrix3x2>(m =>
|
||||
{
|
||||
//validate matrix in here
|
||||
|
@ -100,11 +100,11 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
Assert.Equal(targetMatrix, m);
|
||||
|
||||
}).Returns(mockPath.Object);
|
||||
}).Returns(this.mockPath.Object);
|
||||
|
||||
mockPath.Object.Translate(x, y);
|
||||
this.mockPath.Object.Translate(x, y);
|
||||
|
||||
mockPath.Verify(p => p.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
this.mockPath.Verify(p => p.Transform(It.IsAny<Matrix3x2>()), Times.Once);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
new Vector2(20, 100)));
|
||||
|
||||
IEnumerable<IPath> shapes = this.Clip(triangle, cutout);
|
||||
Assert.Equal(1, shapes.Count());
|
||||
Assert.Single(shapes);
|
||||
Assert.DoesNotContain(triangle, shapes);
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
public void OverlappingTriangles()
|
||||
{
|
||||
IEnumerable<IPath> shapes = this.Clip(this.BigTriangle, this.LittleTriangle);
|
||||
Assert.Equal(1, shapes.Count());
|
||||
Assert.Single(shapes);
|
||||
IReadOnlyList<PointF> path = shapes.Single().Flatten().First().Points;
|
||||
Assert.Equal(7, path.Count);
|
||||
foreach (Vector2 p in this.BigTriangle.Flatten().First().Points)
|
||||
|
@ -88,7 +88,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
IEnumerable<RectangularPolygon> shapes = this.Clip(this.TopLeft, this.TopRight)
|
||||
.OfType<Polygon>().Select(x => (RectangularPolygon)x);
|
||||
|
||||
Assert.Equal(1, shapes.Count());
|
||||
Assert.Single(shapes);
|
||||
Assert.Contains(this.TopLeft, shapes);
|
||||
|
||||
Assert.DoesNotContain(this.TopRight, shapes);
|
||||
|
@ -99,7 +99,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
{
|
||||
IEnumerable<IPath> shapes = this.Clip(this.BigSquare, this.TopLeft);
|
||||
|
||||
Assert.Equal(1, shapes.Count());
|
||||
Assert.Single(shapes);
|
||||
Assert.DoesNotContain(this.BigSquare, shapes);
|
||||
Assert.DoesNotContain(this.TopLeft, shapes);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
public void TouchingButNotOverlapping()
|
||||
{
|
||||
IEnumerable<IPath> shapes = this.Clip(this.TopMiddle, this.TopLeft);
|
||||
Assert.Equal(1, shapes.Count());
|
||||
Assert.Single(shapes);
|
||||
Assert.DoesNotContain(this.TopMiddle, shapes);
|
||||
Assert.DoesNotContain(this.TopLeft, shapes);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ namespace SixLabors.Shapes.Tests.PolygonClipper
|
|||
public void ClippingRectanglesCreateCorrectNumberOfPoints()
|
||||
{
|
||||
IEnumerable<ISimplePath> paths = new RectangularPolygon(10, 10, 40, 40).Clip(new RectangularPolygon(20, 0, 20, 20)).Flatten();
|
||||
Assert.Equal(1, paths.Count());
|
||||
Assert.Single(paths);
|
||||
IReadOnlyList<PointF> points = paths.First().Points;
|
||||
|
||||
Assert.Equal(8, points.Count);
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace SixLabors.Shapes.Tests
|
|||
{
|
||||
Polygon poly = new Polygon(new LinearLineSegment(new PointF(0, 0), new PointF(0, 10), new PointF(5, 5)));
|
||||
ISimplePath[] paths = poly.Flatten().ToArray();
|
||||
Assert.Equal(1, paths.Length);
|
||||
Assert.Single(paths);
|
||||
Assert.Equal(poly, paths[0]);
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ namespace SixLabors.Shapes.Tests
|
|||
{
|
||||
Polygon poly = new Polygon(new LinearLineSegment(new PointF(0, 0), new PointF(0, 10)), new LinearLineSegment(new PointF(2, 5), new PointF(5, 5)));
|
||||
ISimplePath[] paths = poly.Flatten().ToArray();
|
||||
Assert.Equal(1, paths.Length);
|
||||
Assert.Single(paths);
|
||||
Assert.Equal(poly, paths[0]);
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ namespace SixLabors.Shapes.Tests
|
|||
IPath shape = new RectangularPolygon(1, 1, 10, 10);
|
||||
IEnumerable<PointF> intersections = shape.FindIntersections(new PointF(0, 5), new PointF(5, 5));
|
||||
|
||||
Assert.Equal(1, intersections.Count());
|
||||
Assert.Single(intersections);
|
||||
Assert.Equal(new PointF(1, 5), intersections.First());
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ namespace SixLabors.Shapes.Tests
|
|||
IPath shape = new RectangularPolygon(1, 1, 10, 10);
|
||||
IEnumerable<PointF> intersections = shape.FindIntersections(new PointF(0, 5), new PointF(-5, 5));
|
||||
|
||||
Assert.Equal(0, intersections.Count());
|
||||
Assert.Empty(intersections);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.0-rc1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||
<PackageReference Include="xunit" Version="2.2.0" />
|
||||
<PackageReference Include="Moq" Version="4.7.99" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
|
||||
<PackageReference Include="xunit" Version="2.3.1" />
|
||||
<PackageReference Include="Moq" Version="4.8.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -31,13 +31,13 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
public void Serialize(IXunitSerializationInfo info)
|
||||
{
|
||||
info.AddValue("X", X);
|
||||
info.AddValue("Y", Y);
|
||||
info.AddValue("X", this.X);
|
||||
info.AddValue("Y", this.Y);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"({X}, {Y})";
|
||||
return $"({this.X}, {this.Y})";
|
||||
}
|
||||
|
||||
public static implicit operator PointF(TestPoint p)
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace SixLabors.Shapes.Tests
|
|||
|
||||
public void Serialize(IXunitSerializationInfo info)
|
||||
{
|
||||
info.AddValue("width", Width);
|
||||
info.AddValue("height", Height);
|
||||
info.AddValue("width", this.Width);
|
||||
info.AddValue("height", this.Height);
|
||||
}
|
||||
|
||||
public static implicit operator SizeF(TestSize p)
|
||||
|
@ -43,7 +43,7 @@ namespace SixLabors.Shapes.Tests
|
|||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Width}x{Height}";
|
||||
return $"{this.Width}x{this.Height}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче