Esempio n. 1
0
    public void GetMapping()
    {
      string xmlFile = "TestDefault";
      InputHandler inputHandler = new InputHandler(xmlFile);

      int layer = 0;
      string condition = "*";
      string conProperty = "-1";
      string command = "ACTION";
      string cmdProperty = "93";
      int cmdKeyChar = 48;
      int cmdKeyCode = 0;
      string sound = "cursor.wav";
      bool focus = true;

      InputHandler.Mapping mapExpected = new InputHandler.Mapping(layer, condition, conProperty, command, cmdProperty,
                                                                  cmdKeyChar, cmdKeyCode, sound, focus);
      InputHandler.Mapping mapTest = inputHandler.GetMapping("0");

      Assert.AreEqual(mapExpected.Layer, mapTest.Layer);
      Assert.AreEqual(mapExpected.Condition, mapTest.Condition);
      Assert.AreEqual(mapExpected.ConProperty, mapTest.ConProperty);
      Assert.AreEqual(mapExpected.Command, mapTest.Command);
      Assert.AreEqual(mapExpected.CmdProperty, mapTest.CmdProperty);
      Assert.AreEqual(mapExpected.CmdKeyChar, mapTest.CmdKeyChar);
      Assert.AreEqual(mapExpected.CmdKeyCode, mapTest.CmdKeyCode);
      Assert.AreEqual(mapExpected.Sound, mapTest.Sound);
      Assert.AreEqual(mapExpected.Focus, mapTest.Focus);
    }
Esempio n. 2
0
    public void MappingConstructor()
    {
      int layer = 0;
      string condition = "*";
      string conProperty = "-1";
      string command = "ACTION";
      string cmdProperty = "93";
      int cmdKeyChar = 48;
      int cmdKeyCode = 0;
      string sound = "cursor.wav";
      bool focus = true;

      InputHandler.Mapping mapTest = new InputHandler.Mapping(layer, condition, conProperty, command, cmdProperty,
                                                              cmdKeyChar, cmdKeyCode, sound, focus);

      Assert.AreEqual(layer, mapTest.Layer);
      Assert.AreEqual(condition, mapTest.Condition);
      Assert.AreEqual(conProperty, mapTest.ConProperty);
      Assert.AreEqual(command, mapTest.Command);
      Assert.AreEqual(cmdProperty, mapTest.CmdProperty);
      Assert.AreEqual(cmdKeyChar, mapTest.CmdKeyChar);
      Assert.AreEqual(cmdKeyCode, mapTest.CmdKeyCode);
      Assert.AreEqual(sound, mapTest.Sound);
      Assert.AreEqual(focus, mapTest.Focus);
    }