Return emulator from helper function, remove casts to Emulator

- Use variable name that reflects type
This commit is contained in:
John Lewin 2017-06-02 19:57:15 -07:00
parent ccd83ba673
commit b0957cdd13
5 changed files with 13 additions and 19 deletions

View file

@ -55,7 +55,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.CloseSignInAndPrinterSelect();
// make a jump start printer
using (var emulatorProcess = testRunner.LaunchAndConnectToPrinterEmulator("JumpStart", "V1", runSlow: false))
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("JumpStart", "V1", runSlow: false))
{
// make sure it is showing the correct button
Assert.IsTrue(!testRunner.WaitForName("Start Print Button", .5), "Start Print hidden");

View file

@ -510,7 +510,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
// Navigate to Local Library
testRunner.ClickByName("Library Tab");

View file

@ -23,7 +23,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
@ -65,9 +65,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator("Pulse", "A-134"))
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("Pulse", "A-134"))
{
var emulator = emulatorDisposable as Emulator;
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
// close the finish setup window
@ -221,9 +220,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
var emulator = emulatorDisposable as Emulator;
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
testRunner.SwitchToAdvancedSliceSettings();
@ -276,7 +274,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
@ -371,7 +369,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
ExtrusionMultiplyerStream.ExtrusionRatio = initialExtrusionRate;
// Then validate that they are picked up
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
@ -451,10 +449,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Emulator emulator = (Emulator)emulatorDisposable;
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
testRunner.ClickByName("Queue... Menu", 2);
@ -499,10 +495,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Emulator emulator = (Emulator)emulatorDisposable;
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
testRunner.ClickByName("Start Print Button", 1);

View file

@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
Assert.IsTrue(ProfileManager.Instance.ActiveProfile != null);
@ -113,7 +113,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
{
testRunner.WaitForName("Cancel Wizard Button", 1);
using (var emulatorDisposable = testRunner.LaunchAndConnectToPrinterEmulator())
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator())
{
ActiveSliceSettings.Instance.SetValue(SettingsKey.cancel_gcode, "G28 ; Cancel GCode");