Skip to content

Instantly share code, notes, and snippets.

@patrick711
Created April 23, 2020 21:25
Show Gist options
  • Save patrick711/e726a91408a43f0475f3ef2082a710ae to your computer and use it in GitHub Desktop.
Save patrick711/e726a91408a43f0475f3ef2082a710ae to your computer and use it in GitHub Desktop.
Acumatica Test SDK main script
/***************************
Test_Combined - Control object that runs when the test is executed
Patrick Chen SPS Commerce
04-2020
***************************/
namespace TestAcumatica
{
class Test_Combined: BeforeAndAfter
{
public override void Execute()
{
#region Setup and display Variables
//Vars
String sConfig = Config.SITE_SRC_LOGIN.ToString(); // get Inputs
InputVars myVars = new InputVars();
Mod_SetupVars dispVars = new Mod_SetupVars();
dispVars.Setup(sConfig, ref myVars);
#endregion
#region Unpublish and Restore
if (myVars.restore)
{
if (String.IsNullOrEmpty(myVars.sQLServerName) || String.IsNullOrEmpty(myVars.databaseName) || string.IsNullOrEmpty(myVars.backupLocation))
throw new Exception("Not enough inputs to attempt Restore");
if (!File.Exists(myVars.backupLocation.ToString()))
{
Console.WriteLine("Backup file not found! " + myVars.backupLocation.ToString());
throw new Exception("Backup File not found!");
}
Mod_RestoreDB restore = new Mod_RestoreDB();
restore.ResetSite(myVars);
}
#endregion
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment