public void GetDistanceOneLine() { // only hall adjacent // A-a-B TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext( new Loc(22, 14), new Rect[] { Rect.Empty, Rect.Empty }, new Rect[] { Rect.Empty }, new Tuple <char, char>[] { Tuple.Create('A', 'a'), Tuple.Create('a', 'B') }); int distance = floorPlan.GetDistance(new RoomHallIndex(0, false), new RoomHallIndex(1, false)); Assert.That(distance, Is.EqualTo(2)); }
public void GetDistanceSame() { // same start and end // A-B TestFloorPlan floorPlan = TestFloorPlan.InitFloorToContext( new Loc(22, 14), new Rect[] { Rect.Empty, Rect.Empty }, Array.Empty <Rect>(), new Tuple <char, char>[] { Tuple.Create('A', 'B') }); int distance = floorPlan.GetDistance(new RoomHallIndex(0, false), new RoomHallIndex(0, false)); Assert.That(distance, Is.EqualTo(0)); }