Skip to content

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
9swampy committed Aug 6, 2022
2 parents fe4e215 + 18af210 commit fd1aac8
Show file tree
Hide file tree
Showing 184 changed files with 20,105 additions and 3,838 deletions.
2 changes: 2 additions & 0 deletions DeepNestLib.CiTests/CanBePlacedFixture.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace DeepNestLib.CiTests
{
using System.Linq;
using DeepNestLib.CiTests.IO;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
using Xunit;
Expand Down
1 change: 1 addition & 0 deletions DeepNestLib.CiTests/ClipperIntersectFixture.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace DeepNestLib.CiTests
{
using System.Collections.Generic;
using DeepNestLib.CiTests.IO;
using DeepNestLib.Geometry;
using FluentAssertions;
using IxMilia.Dxf.Entities;
Expand Down
3 changes: 3 additions & 0 deletions DeepNestLib.CiTests/CompareMinkowskiImplementationsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using DeepNestLib.CiTests.IO;
using DeepNestLib.IO;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
using IxMilia.Dxf.Entities;
Expand Down
7 changes: 6 additions & 1 deletion DeepNestLib.CiTests/DeepNestLib.CiTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<None Remove="ReadMe\ReadMeExampleSmall.dnest" />
<None Remove="ReadMe\ReadMeExampleSmall.dnr" />
<None Remove="ReadMe\ReadMeExampleSmall.dxf" />
<None Remove="ReadMe\ReadMeExampleSmallColoured.dxf" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="20x20outer10x10hole.dxf">
Expand Down Expand Up @@ -229,6 +230,7 @@
<EmbeddedResource Include="ReadMe\ReadMeExampleSmall.dnest" />
<EmbeddedResource Include="ReadMe\ReadMeExampleSmall.dnr" />
<EmbeddedResource Include="ReadMe\ReadMeExampleSmall.dxf" />
<EmbeddedResource Include="ReadMe\ReadMeExampleSmallColoured.dxf" />
</ItemGroup>
<ItemGroup>
<Resource Include="Placement\PartPlacementScenarioNewMinkowski-MinkowskiOutNfp.dnpoly" />
Expand All @@ -243,6 +245,9 @@
<EmbeddedResource Include="..\DeepNestPort\dxfs\_4.dxf" Link="Dxfs\_4.dxf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="..\DeepNestPort\dxfs\_3.dxf" Link="Dxfs\_3.dxf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<None Include="..\MinkowskiDlls\minkowski.dll" Link="minkowski.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand All @@ -258,7 +263,7 @@
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="IxMilia.Dxf" Version="0.8.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace DeepNestLib.CiTests.DummyFactories
{
using DeepNestLib.Placement;
using FakeItEasy;

internal class DummyMinkowskiSumFactory : DummyFactory<MinkowskiSum>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace DeepNestLib.CiTests.DummyFactories
{
using DeepNestLib.Placement;
using FakeItEasy;

internal class DummyNfpHelperFactory : DummyFactory<NfpHelper>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace DeepNestLib.CiTests.DummyFactories
{
using System.Collections.Generic;
using DeepNestLib.Placement;
using FakeItEasy;

internal class DummyPartPlacementWorkerFactory : DummyFactory<PartPlacementWorker>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
{
using System.Collections.Generic;
using System.Diagnostics;
using DeepNestLib.GeneticAlgorithm;
using FakeItEasy;

internal class DummyPlacementWorkerFactory : DummyFactory<PlacementWorker>
{
protected override PlacementWorker Create()
{
return new PlacementWorker(A.Dummy<NfpHelper>(), new List<ISheet>(), new Chromosome[0], A.Fake<ISvgNestConfig>(), A.Dummy<Stopwatch>(), A.Fake<INestState>());
return new PlacementWorker(A.Dummy<NfpHelper>(), new List<ISheet>(), new DeepNestGene(new Chromosome[0]), A.Fake<ISvgNestConfig>(), A.Dummy<Stopwatch>(), A.Fake<INestState>());
}
}
}
74 changes: 0 additions & 74 deletions DeepNestLib.CiTests/DxfParserPart1Fixture.cs

This file was deleted.

2 changes: 2 additions & 0 deletions DeepNestLib.CiTests/Dxfs/SquareWithHoleFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
{
using System.IO;
using System.Reflection;
using DeepNestLib.CiTests.IO;
using DeepNestLib.IO;
using FluentAssertions;
using Xunit;

Expand Down
85 changes: 0 additions & 85 deletions DeepNestLib.CiTests/ExtensionsSpliceFixture.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System;
using System.Diagnostics;
using DeepNestLib.CiTests.GeneticAlgorithm;
using DeepNestLib.CiTests.IO;
using DeepNestLib.GeneticAlgorithm;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
Expand Down Expand Up @@ -32,7 +34,7 @@ public FitFourSmallSquaresInOneLargerSquareSheetPerfectlyBoundingBoxFitnessFixtu
DxfGenerator.GenerateSquare("fourthPart", 11D, RectangleType.FitFour).TryConvertToNfp(fourthPartIdSrc, 180, out fourthPart).Should().BeTrue();
var config = new TestSvgNestConfig();
config.PlacementType = PlacementTypeEnum.BoundingBox;
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new Chromosome[] { firstPart, secondPart, thirdPart, fourthPart }.ApplyIndex(), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new DeepNestGene(new Chromosome[] { firstPart, secondPart, thirdPart, fourthPart }.ApplyIndex()), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
using System;
using System.Diagnostics;
using DeepNestLib.CiTests.GeneticAlgorithm;
using DeepNestLib.CiTests.IO;
using DeepNestLib.GeneticAlgorithm;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
Expand Down Expand Up @@ -31,7 +34,7 @@ public FitFourSmallSquaresInOneLargerSquareSheetPerfectlyFixture()
DxfGenerator.GenerateSquare("fourthPart", 11D, RectangleType.FitFour).TryConvertToNfp(fourthPartIdSrc, 180, out fourthPart).Should().BeTrue();
var config = new TestSvgNestConfig();
config.PlacementType = PlacementTypeEnum.Gravity;
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new Chromosome[] { firstPart, secondPart, thirdPart, fourthPart }.ApplyIndex(), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new DeepNestGene(new Chromosome[] { firstPart, secondPart, thirdPart, fourthPart }.ApplyIndex()), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{
using System;
using System.Diagnostics;
using DeepNestLib.CiTests.GeneticAlgorithm;
using DeepNestLib.CiTests.IO;
using DeepNestLib.GeneticAlgorithm;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
Expand All @@ -23,7 +26,7 @@ public FitOnlyOneOfTwoSmallSquaresPartInOneLargerSquareSheetsFixture()
DxfGenerator.GenerateSquare("Part", 11D, RectangleType.FileLoad).TryConvertToNfp(firstPartIdSrc, out firstPart).Should().BeTrue();
Chromosome secondPart;
DxfGenerator.GenerateSquare("Part", 11D, RectangleType.FileLoad).TryConvertToNfp(secondPartIdSrc, out secondPart).Should().BeTrue();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new Chromosome[] { firstPart, secondPart }.ApplyIndex(), new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet }, new DeepNestGene(new Chromosome[] { firstPart, secondPart }.ApplyIndex()), new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace DeepNestLib.CiTests
{
using System.Diagnostics;
using DeepNestLib.CiTests.IO;
using DeepNestLib.GeneticAlgorithm;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
Expand All @@ -17,13 +19,13 @@ public FitSmallSquarePartInLargerSquareSheetFixture()
DxfGenerator.GenerateSquare("Sheet", 22D, RectangleType.FileLoad).TryConvertToSheet(0, out sheet).Should().BeTrue();
Chromosome part;
DxfGenerator.GenerateSquare("Part", 11D, RectangleType.FileLoad).TryConvertToNfp(0, out part).Should().BeTrue();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { sheet }, new Chromosome[] { part }, new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { sheet }, new DeepNestGene(new Chromosome[] { part }), new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
}

[Fact]
public void GivenNullSheetsPassedInThenNullReturned()
{
new PlacementWorker(A.Dummy<NfpHelper>(), null, new Chromosome[] { new Chromosome(new NoFitPolygon(), 0) }, new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts().Should().BeNull();
new PlacementWorker(A.Dummy<NfpHelper>(), null, new DeepNestGene(new Chromosome[] { new Chromosome(new NoFitPolygon(), 0) }), new TestSvgNestConfig(), A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts().Should().BeNull();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using System;
using System.Diagnostics;
using DeepNestLib.CiTests.GeneticAlgorithm;
using DeepNestLib.CiTests.IO;
using DeepNestLib.GeneticAlgorithm;
using DeepNestLib.Placement;
using FakeItEasy;
using FluentAssertions;
Expand Down Expand Up @@ -32,7 +34,7 @@ public FitTwoSmallSquaresPartInTwoLargerSquareSheetsFixture()
A.CallTo(() => config.UseDllImport).Returns(false);
A.CallTo(() => config.Rotations).Returns(2);
A.CallTo(() => config.ExportExecutions).Returns(false);
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet, secondSheet }, new Chromosome[] { firstPart, secondPart }.ApplyIndex(), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
this.nestResult = new PlacementWorker(A.Dummy<NfpHelper>(), new ISheet[] { firstSheet, secondSheet }, new DeepNestGene(new Chromosome[] { firstPart, secondPart }.ApplyIndex()), config, A.Dummy<Stopwatch>(), A.Fake<INestState>()).PlaceParts();
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void Test()
A.CallTo(() => sheetPlacementVertical.PlacementType).Returns(PlacementTypeEnum.Gravity);
var sheetSquare = A.Fake<ISheet>();
A.CallTo(() => sheetSquare.Area).Returns(Math.Pow(Math.Max(small, large), 2));
A.CallTo(() => sheetSquare.Width).Returns(Math.Max(small, large));
A.CallTo(() => sheetSquare.WidthCalculated).Returns(Math.Max(small, large));
A.CallTo(() => sheetPlacementVertical.Sheet).Returns(sheetSquare);
var hull = A.Fake<INfp>();
A.CallTo(() => hull.Area).Returns(small * large);
Expand Down
Loading

0 comments on commit fd1aac8

Please sign in to comment.