Ejemplo n.º 1
0
 public void TestConstructor()
 {
     _mockProfileService = new Mock <IProfileService>();
     _mockProfileService.SetupProperty(m => m.ActiveProfile.FlatDeviceSettings.PortName, "");
     _sut = new AlnitakFlatDevice(_mockProfileService.Object);
     Assert.That(_sut.Id, Is.EqualTo("817b60ab-6775-41bd-97b5-3857cc676e51"));
 }
Ejemplo n.º 2
0
 public void Init()
 {
     _mockProfileService = new Mock <IProfileService>();
     _mockProfileService.SetupProperty(m => m.ActiveProfile.FlatDeviceSettings.PortName, "COM3");
     _mockSdk = new Mock <IAlnitakDevice>();
     _sut     = new AlnitakFlatDevice(_mockProfileService.Object)
     {
         Sdk = _mockSdk.Object
     };
 }
Ejemplo n.º 3
0
        public void Init()
        {
            _mockProfileService.Reset();
            _mockProfileService.SetupProperty(m => m.ActiveProfile.FlatDeviceSettings.PortName, "COM3");

            _mockSdk.Reset();
            _mockSdk.Setup(m => m.InitializeSerialPort(It.IsAny <string>(), It.IsAny <object>(), It.IsAny <int>()))
            .Returns(Task.FromResult(true));
            _mockSdk.Setup(m => m.SendCommand <StateResponse>(It.IsAny <StateCommand>()))
            .Returns(Task.FromResult(new StateResponse {
                DeviceResponse = "*S99000"
            }));
            _mockSdk.Setup(m => m.SendCommand <FirmwareVersionResponse>(It.IsAny <FirmwareVersionCommand>()))
            .Returns(Task.FromResult(new FirmwareVersionResponse {
                DeviceResponse = "*V99124"
            }));
            _sut = new AlnitakFlatDevice(_mockProfileService.Object)
            {
                Sdk = _mockSdk.Object
            };
        }