Skip to content

Commit

Permalink
#58 Added more tests for main menu and markers in app
Browse files Browse the repository at this point in the history
  • Loading branch information
burnsoftnet committed Jan 5, 2023
1 parent 44dfc47 commit 8754e88
Show file tree
Hide file tree
Showing 4 changed files with 1,061 additions and 876 deletions.
108 changes: 107 additions & 1 deletion BSMyGunCollection.UnitTest.Command.Helpers/UI/FrmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,114 @@ internal static List<BatchCommandList> ClickOnBackup(bool verify = false)
return ClickOn(SectionName, "Backup", verify);
}
}


internal class EditMenu
{
private static string SectionName = "Edit Menu";

internal static List<BatchCommandList> ClickOnEdit(bool verify = false)
{
return ClickOn(SectionName, "Edit", verify);
}

internal static List<BatchCommandList> ClickOnManufactures(bool verify = false)
{
return ClickOn(SectionName, "Manufacturers", verify);
}

internal static List<BatchCommandList> ClickOnAmmoType(bool verify = false)
{
return ClickOn(SectionName, "AmooType", verify);
}

internal static List<BatchCommandList> ClickOnModelTypes(bool verify = false)
{
return ClickOn(SectionName, "ManageModels", verify);
}

internal static List<BatchCommandList> ClickOnPlaceOfOrgin(bool verify = false)
{
return ClickOn(SectionName, "PlaceOfOrigin", verify);
}

internal static List<BatchCommandList> ClickOnGripTypes(bool verify = false)
{
return ClickOn(SectionName, "GripTypes", verify);
}

internal static List<BatchCommandList> ClickOnFirearmConditions(bool verify = false)
{
return ClickOn(SectionName, "FirearmConditions", verify);
}

internal static List<BatchCommandList> ClickOnFirearmTypes(bool verify = false)
{
return ClickOn(SectionName, "FirearmTypes", verify);
}
internal static List<BatchCommandList> ClickOnClassification(bool verify = false)
{
return ClickOn(SectionName, "Classification", verify);
}
}

internal class AddItemMenu
{
private static string SectionName = "Add Item Menu";

internal static List<BatchCommandList> ClickOnAddItem(bool verify = false)
{
return ClickOn(SectionName, "AddItem", verify);
}

internal static List<BatchCommandList> ClickOnAddFirearm(bool verify = false)
{
return ClickOn(SectionName, "AddFirearm", verify);
}

internal static List<BatchCommandList> ClickOnAddAmmunitiontomyCollection(bool verify = false)
{
return ClickOn(SectionName, "AddAmmunitiontomyCollection", verify);
}

internal static List<BatchCommandList> ClickOnAddtoWishlist(bool verify = false)
{
return ClickOn(SectionName, "AddtoWishlist", verify);
}

internal static List<BatchCommandList> ClickOnAddManufacturer(bool verify = false)
{
return ClickOn(SectionName, "AddManufacturer", verify);
}

internal static List<BatchCommandList> ClickOnAddAmmunitionType(bool verify = false)
{
return ClickOn(SectionName, "AddAmmunitionType", verify);
}

internal static List<BatchCommandList> ClickOnAddFirearmClassification(bool verify = false)
{
return ClickOn(SectionName, "AddFirearmClassification", verify);
}

internal static List<BatchCommandList> ClickOnAddModel(bool verify = false)
{
return ClickOn(SectionName, "AddModel", verify);
}
internal static List<BatchCommandList> ClickOnAddPlaceofOrigin(bool verify = false)
{
return ClickOn(SectionName, "AddPlaceofOrigin", verify);
}

internal static List<BatchCommandList> ClickOnMaintenancePlan(bool verify = false)
{
return ClickOn(SectionName, "MaintenancePlan", verify);
}

internal static List<BatchCommandList> ClickOnDocument(bool verify = false)
{
return ClickOn(SectionName, "Document", verify);
}
}
/// <summary>
/// Clicks the on button.
/// </summary>
Expand Down
66 changes: 63 additions & 3 deletions BSMyGunCollection.UnitTest.Command.Helpers/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,78 @@ public class MainWindow
{
public class MainMenu
{
public static List<BatchCommandList> RunTest(bool verify = false)
public static List<BatchCommandList> RunTest(bool verify = false, bool runFile = true, bool runEdit = true, bool runAddItems = true)
{
List<BatchCommandList> cmd = new List<BatchCommandList>();
if (runFile) cmd.AddRange(RunTestFileMenu(verify));
if (runEdit) cmd.AddRange(RunTestEditMenu(verify));
if (runAddItems) cmd.AddRange(RunTestAddItemsMenu(verify));
return cmd;
}

private static List<BatchCommandList> RunTestFileMenu(bool verify = false)
{
List<BatchCommandList> cmd = new List<BatchCommandList>();
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnFile(verify));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnImport(verify));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnFile(verify));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnBackup(true));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnExit(true));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnRestore(true));
//TODO: Functions do not Work Try to Fix Later
//cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnExit(true));
//cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnRestore(true));
cmd.AddRange(FrmMain.Menu.FileMenu.ClickOnFile(verify));
return cmd;
}

private static List<BatchCommandList> RunTestEditMenu(bool verify = false)
{
List<BatchCommandList> cmd = new List<BatchCommandList>();
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnManufactures(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnAmmoType(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnModelTypes(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnPlaceOfOrgin(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnGripTypes(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnFirearmConditions(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnFirearmTypes(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnClassification(verify));
cmd.AddRange(FrmMain.Menu.EditMenu.ClickOnEdit(verify));
return cmd;
}

private static List<BatchCommandList> RunTestAddItemsMenu(bool verify = false)
{
List<BatchCommandList> cmd = new List<BatchCommandList>();
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddFirearm(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddAmmunitiontomyCollection(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddtoWishlist(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddManufacturer(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddAmmunitionType(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddFirearmClassification(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddModel(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddPlaceofOrigin(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnMaintenancePlan(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnDocument(verify));
cmd.AddRange(FrmMain.Menu.AddItemMenu.ClickOnAddItem(verify));
return cmd;
}
}
public class SideMenu
{
Expand Down
14 changes: 14 additions & 0 deletions BSMyGunCollection/MDIParent1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8754e88

Please sign in to comment.