Skip to content
Permalink
Browse files

RoomMap - change bad direction message

  • Loading branch information...
bobbymcr committed Dec 16, 2018
1 parent 3bc7974 commit b8e2530b7e4ef2e9c0942455e32cba8f41196df1
Showing with 9 additions and 3 deletions.
  1. +7 −1 core/src/RoomMap.cs
  2. +2 −2 core/test/RoomMapTest.cs
@@ -115,7 +115,13 @@ Point IPointPrivate.Go(string direction)
{
if (!this.targets.TryGetValue(direction, out Point target))
{
this.bus.Output($"You can't go {direction}.");
string badDir = direction;
if (string.IsNullOrEmpty(badDir))
{
badDir = "that way";
}

this.bus.Output($"You can't go {badDir}.");
}

return target;
@@ -237,12 +237,12 @@ public void ConnectRoomToItself()

p1.ConnectTo(p1, "north");
map.Start(p1);
bus.Send(new GoMessage("south"));
bus.Send(new GoMessage(string.Empty));
bus.Send(new GoMessage("north"));

messages.Should().Equal(
"You are in a test room.",
"You can't go south.",
"You can't go that way.",
"You are in a test room.");
}
}

0 comments on commit b8e2530

Please sign in to comment.
You can’t perform that action at this time.