public void TestSpiralForEach2() { var spi = SpiralIterators.Flat(new Vector2Int(2, 2), new Vector2Int(2, 1), new Vector2Int(1, 0)); IList <Vector2Int> assume = new List <Vector2Int> { new Vector2Int(2, 1), new Vector2Int(2, 0), new Vector2Int(2, -1), new Vector2Int(2, -2), new Vector2Int(1, -2), new Vector2Int(0, -2), new Vector2Int(-1, -2), new Vector2Int(-2, -2), new Vector2Int(-2, -1), new Vector2Int(-2, 0), new Vector2Int(-2, 1), new Vector2Int(-2, 2), new Vector2Int(-1, 2), new Vector2Int(0, 2), new Vector2Int(1, 2), new Vector2Int(2, 2) }; IList <Vector2Int> test = new List <Vector2Int>(); foreach (Vector2Int v in spi) { test.Add(v); } Assert.IsTrue(assume.SequenceEqual(test), $"Lists not equal:\n\tAssumed:{String.Join(", ", assume)}\n\tTest:{String.Join(", ", test)}"); }
public void TestSpiralFlatInstantiation() { SpiralIterators.Flat(new Vector2Int(0, 0)); }