Example #1
0
 public void should_ignore_requests_to_stop_if_buzzer_not_started()
 {
     using (var device = new Device())
     {
         device.Open();
         device.StopBuzzer();
     }
 }
Example #2
0
 public void should_start_buzzer()
 {
     using (var device = new Device())
     {
         device.Open();
         device.StartBuzzer(100, 2, 20, 20);
         Thread.Sleep(3000);
     }
 }
Example #3
0
 public void should_flash_yellow_light()
 {
     using (var device = new Device())
     {
         device.Open();
         device.Flash(Color.Yellow);
         Thread.Sleep(3000);
     }
 }
Example #4
0
 public void should_flash_green_light()
 {
     using (var device = new Device())
     {
         device.Open();
         device.Flash(Color.Green);
         Thread.Sleep(3000);
     }
 }
Example #5
0
 public void should_allow_all_lights_and_sound_at_once()
 {
     using (var device = new Device())
     {
         device.Open();
         device.TurnOn(Color.Green);
         device.TurnOn(Color.Yellow);
         device.TurnOn(Color.Red);
         device.StartBuzzer(50, 2, 20, 10);
         Thread.Sleep(1000);
     }
 }
Example #6
0
 void ReAttachDeviceIfRequired(object sender, EventArrivedEventArgs e)
 {
     lock (device)
     {
         if (device == null)
             device = new Device();
         else
         {
             var tempDevice = new Device();
             if (tempDevice.Name != device.Name)
             {
                 device.Dispose();
                 device = tempDevice;
             }
         }
     }
     UpdateStatus(lastCompletedState, lastUpdateTime);
 }
Example #7
0
 public DelcomOutput()
 {
     device = new Device();
     ListenForDeviceConnectionChanges();
 }
Example #8
0
 public void should_turn_on_green_light()
 {
     using (var device = new Device())
     {
         device.Open();
         device.TurnOn(Color.Green);
         Thread.Sleep(1000);
     }
 }
Example #9
0
 public void should_open_single_attached_device()
 {
     using (var device = new Device())
         Assert.DoesNotThrow(() => device.Open());
 }
Example #10
0
 public void x_should_turn_off_all_lights_and_sounds_when_finalized()
 {
     var device = new Device();
     device.Open();
     device.TurnOn(Color.Green);
     device.TurnOn(Color.Yellow);
     device.TurnOn(Color.Red);
     device.StartBuzzer(150, 2, 20, 10);
     Thread.Sleep(1000);
 }