public void KeysAreBound() { INonNpc npc = new PlayerTwo(); npc.OpenControls(); Assert.AreEqual(true, npc.KeyStroke(Key.Left)); Assert.AreEqual(Pick.Rock,npc.Pick); npc.OpenControls(); Assert.AreEqual(true, npc.KeyStroke(Key.Down)); Assert.AreEqual(Pick.Paper, npc.Pick); npc.OpenControls(); Assert.AreEqual(true, npc.KeyStroke(Key.Right)); Assert.AreEqual(Pick.Scissors, npc.Pick); }
public void KeysArentAccepted() { INonNpc npc = new PlayerTwo(); for (int i = 1; i < 172; i++) { var key = (Key)i; npc.OpenControls(); if (key != Key.Left && key != Key.Down && key != Key.Right) Assert.AreEqual(false, npc.KeyStroke(key)); } }