From 9dc789c3ec44582e31d382c235118e5f7ac8579b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20LAVERGNE?= Date: Tue, 28 May 2024 17:08:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Ajout=20des=20tests=20pour?= =?UTF-8?q?=20les=20r=C3=A8gles=20decheminsde=20corde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Trek-12/Tests/RulesTests.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/source/Trek-12/Tests/RulesTests.cs b/source/Trek-12/Tests/RulesTests.cs index 3b6fe48..a0e46fe 100644 --- a/source/Trek-12/Tests/RulesTests.cs +++ b/source/Trek-12/Tests/RulesTests.cs @@ -73,4 +73,26 @@ public class RulesTests Cell cell2 = new Cell(1, 1); Assert.True(rules.IsCellAdjacent(cell1, cell2)); } + + [Fact] + public void IsInRopePaths_ReturnsTrue_WhenCellsAreInRopePaths() + { + Rules rules = new Rules(); + Cell cell1 = new Cell(0, 0); + Cell cell2 = new Cell(0, 1); + Map map = new Map("background"); + map.RopePaths.Add(new List { cell1, cell2 }); + Assert.True(rules.IsInRopePaths(cell2, map.RopePaths, 0)); + } + + [Fact] + public void IsInRopePaths_ReturnsFalse_WhenCellsAreNotInRopePaths() + { + Rules rules = new Rules(); + Cell cell1 = new Cell(0, 0); + Cell cell2 = new Cell(0, 1); + Map map = new Map("background"); + map.RopePaths.Add(new List { cell1 }); + Assert.False(rules.IsInRopePaths(cell2, map.RopePaths, 0)); + } } \ No newline at end of file