Convert LibraryRemoveSelectedItem to extension method

This commit is contained in:
John Lewin 2017-06-06 18:52:13 -07:00
parent 7401758431
commit 5cbcee976e
3 changed files with 6 additions and 10 deletions

View file

@ -1,9 +1,6 @@
using System;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg.UI;
using MatterHackers.GuiAutomation;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.PrintQueue;
using NUnit.Framework;
@ -161,7 +158,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
// Select and remove item
testRunner.ClickByName("Row Item Rook");
MatterControlUtilities.LibraryRemoveSelectedItem(testRunner);
testRunner.LibraryRemoveSelectedItem();
// Make sure that the item has been removed
Assert.IsFalse(testRunner.WaitForName("Row Item Rook"));
@ -183,7 +180,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.SelectListItems("Row Item Rook", "Row Item Batman");
// Remove items
MatterControlUtilities.LibraryRemoveSelectedItem(testRunner);
testRunner.LibraryRemoveSelectedItem();
testRunner.Delay(1);
// Make sure both selected items are removed

View file

@ -27,7 +27,6 @@ of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg.UI;
@ -121,7 +120,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.SelectListItems("Row Item 2013-01-25_Mouthpiece_v2");
// Remove item
MatterControlUtilities.LibraryRemoveSelectedItem(testRunner);
testRunner.LibraryRemoveSelectedItem();
testRunner.Delay(() => QueueData.Instance.ItemCount == expectedCount, 5, 500);
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should decrease by one after clicking Remove");
@ -148,7 +147,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.SelectListItems("Row Item Batman", "Row Item 2013-01-25_Mouthpiece_v2");
// Remove items
MatterControlUtilities.LibraryRemoveSelectedItem(testRunner);
testRunner.LibraryRemoveSelectedItem();
testRunner.Delay(() => QueueData.Instance.ItemCount == expectedCount, 5, 500);
Assert.AreEqual(expectedCount, QueueData.Instance.ItemCount, "Queue count should decrease by two after clicking Remove");

View file

@ -506,7 +506,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ClickByName("Rename Menu Item", 1);
}
public static void LibraryRemoveSelectedItem(AutomationRunner testRunner)
public static void LibraryRemoveSelectedItem(this AutomationRunner testRunner)
{
testRunner.ClickByName("Print Library Overflow Menu");
testRunner.ClickByName("Remove Menu Item", 1);