using System.Collections.Generic; using Annulus.CSG; using Azimuth; namespace Annulus.UnitTests.CSG { public class SegmentSoupOverlapsTests : UnitTestSharp.TestFixture { public class TouchesTests : UnitTestSharp.TestFixture { private static readonly SimplePolygon Square = new SimplePolygon(PolygonUnionTests.Box(0, 0, 10, 10)); private static readonly SimplePolygon SmallHole = new SimplePolygon(PolygonUnionTests.Hole(2, 2, 3, 3)); private static readonly SimplePolygon Tab = new SimplePolygon(PolygonUnionTests.Box(8, 4, 12, 6)); [UnitTestSharp.IgnoreTest] private SegmentSoupOverlaps SquareWithHoleAgainstTab() { return SegmentSoupOverlaps.FindOverlaps(Square, Tab, new[] { SmallHole }, new List()); } public void LoopTheOtherCrosses_IsTouched() { CheckTrue(SquareWithHoleAgainstTab().Touches(Square)); } public void LoopNoEdgeCrosses_IsNotTouched() { CheckFalse(SquareWithHoleAgainstTab().Touches(SmallHole)); } } } }