Skip to content
Permalink
Browse files

Room - ProcessGo

  • Loading branch information...
bobbymcr committed Dec 16, 2018
1 parent 16ea4b6 commit 81a361081357b5fb4f5609874d352f0dddca93d0
Showing with 18 additions and 0 deletions.
  1. +8 −0 core/src/Room.cs
  2. +9 −0 core/test/RoomTest.cs
  3. +1 −0 core/test/TestRoom.cs
@@ -112,6 +112,14 @@ protected void Drop(Word verb, Word noun)
}
}

protected void Go(Word verb, Word noun)
{
if (noun.Actual.Length == 0)
{
this.Output($"Where do you want to {verb}?");
}
}

protected void Take(Word verb, Word noun)
{
if (noun.Actual.Length == 0)
@@ -205,6 +205,15 @@ public void ProcessLookItemAfterLeave()
messages.Should().Equal("You are in a test room.");
}

[Fact]
public void ProcessGo()
{
TestSend(
new Word("go", "GO"),
new Word(string.Empty, string.Empty),
"Where do you want to GO?");
}

[Fact]
public void ProcessTake()
{
@@ -45,6 +45,7 @@ protected override void EnterCore()
this.Register("take", this.Take);
this.Register("inventory", (_, __) => this.Inventory());
this.Register("drop", this.Drop);
this.Register("go", this.Go);
}

protected override bool LookAtCore(Word noun)

0 comments on commit 81a3610

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