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