Пример #1
0
        public void Start()
        {
            //Recreate database
            ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString("Data Source=.;Integrated Security=SSPI;"));
            DropDatabaseTask.Drop("DemoDB");
            CreateDatabaseTask.Create("DemoDB");

            ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString("Data Source=.;Integrated Security=SSPI;Initial Catalog=DemoDB;"));

            //Logging (only works with existing configuration nlog config in App.config)

            CreateLogTablesTask.CreateLog();
            StartLoadProcessTask.Start("Process 1");
            ControlFlow.STAGE = "Staging";
            SqlTask.ExecuteNonQuery("some sql", "Select 1 as test");
            TransferCompletedForLoadProcessTask.Complete();
            ControlFlow.STAGE = "DataVault";

            Sequence.Execute("some custom code", () => { });
            LogTask.Warn("Some warning!");
            EndLoadProcessTask.End("Everything successful");

            string jsonLP  = GetLoadProcessAsJSONTask.GetJSON();
            string jsonLog = GetLogAsJSONTask.GetJSON(1);
        }
Пример #2
0
        public JsonResult GetDemoProcessList()
        {
            RunETLDemoProcess();
            string     jsonLP = GetLoadProcessAsJSONTask.GetJSON();
            JsonResult result = JsonHelper.ConvertStringToJson(jsonLP);

            return(result);
        }
Пример #3
0
        public void TestGet1LoadProcessAsJSON()
        {
            RunProcess1();
            string response = GetLoadProcessAsJSONTask.GetJSON();
            JArray json     = JArray.Parse(response);

            Assert.AreEqual("Process 1", (string)json[0]["processName"]);
            Assert.AreEqual(false, (bool)json[0]["isRunning"]);
            Assert.AreEqual(true, (bool)json[0]["wasSuccessful"]);
            Assert.AreEqual(false, (bool)json[0]["wasAborted"]);
            Assert.AreEqual(true, (bool)json[0]["isFinished"]);
            Assert.AreEqual(false, (bool)json[0]["isTransferCompleted"]);
            Assert.AreEqual("Start", (string)json[0]["startMessage"]);
            Assert.AreEqual("End", (string)json[0]["endMessage"]);
        }
        public void Get1LoadProcessAsJSON()
        {
            //Arrange
            RunProcess1();

            //Act
            string response = GetLoadProcessAsJSONTask.GetJSON(SqlConnection);
            JArray json     = JArray.Parse(response);

            //Assert
            Assert.Equal("Process 1", (string)json[0]["processName"]);
            Assert.False((bool)json[0]["isRunning"]);
            Assert.True((bool)json[0]["wasSuccessful"]);
            Assert.False((bool)json[0]["wasAborted"]);
            Assert.True((bool)json[0]["isFinished"]);
            Assert.Equal("Start", (string)json[0]["startMessage"]);
            Assert.Equal("End", (string)json[0]["endMessage"]);
        }