public void DataPickerKeysFactory_GetUpAndDownKeys_ShouldReturnVerifoneKeys_WhenVerifoneInfosArePassed()
        {
            // Arrange
            var mock = new Mock <IPinpadInfos>();

            mock.SetupGet(x => x.ManufacturerName).Returns("VERIFONE");
            mock.SetupGet(x => x.Model).Returns("VX820");
            IPinpadInfos infos = mock.Object;

            // Act
            DataPickerKeys keys = infos.GetUpAndDownKeys();

            // Assert
            Assert.IsNotNull(keys);
            Assert.AreEqual(PinpadKeyCode.Function1, keys.UpKey);
            Assert.AreEqual(PinpadKeyCode.Function3, keys.DownKey);
        }
Пример #2
0
 // Constructor
 /// <summary>
 /// Build a data picker with a reference to keyboard and display.
 /// </summary>
 /// <param name="keyboard"><seealso cref="IPinpadKeyboard"/> implementation.</param>
 /// <param name="infos"><seealso cref="IPinpadInfos"/> implementation.</param>
 /// <param name="display"><seealso cref="IPinpadDisplay"/> implementation.</param>
 public DataPicker(IPinpadKeyboard keyboard, IPinpadInfos infos, IPinpadDisplay display)
 {
     this._keyboard      = keyboard;
     this._display       = display;
     this.DataPickerKeys = infos.GetUpAndDownKeys();
 }