Created
April 23, 2020 21:25
-
-
Save patrick711/e726a91408a43f0475f3ef2082a710ae to your computer and use it in GitHub Desktop.
Acumatica Test SDK main script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************** | |
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