public void test_OzasmtFileUsingTask()
  {
      string ozasmtFile =
          MockObjects_Helpers.fetchTestFileFromDeployServer_AndUnzipIt(
              O2CoreResources.DemoOzasmtFile_Hacmebank_WebServices);
      Assert.That(File.Exists(ozasmtFile), "demoFileContents does not exist");
      var task = new Task_LoadAssessmentFiles(new O2AssessmentLoad_OunceV6(), ozasmtFile);
      Assert.That(task.execute(), "Task execution failed");
      Assert.That(task.resultsObject is IO2Assessment, "resultsObject was not O2Assessment");
      var resultsObject = (IO2Assessment) task.resultsObject;
      Assert.That(resultsObject.o2Findings.Count > 0, "No Findings");
      Assert.That(resultsObject.name != null, "results.name was null");
 /*     Assert.That(resultsObject.lastOzasmtImportFile != null, "results.name was null");
      Assert.That(resultsObject.lastOzasmtImportTimeSpan.Milliseconds > 0,
                  "lastOzasmtImportTimeSpan.Milliseconds = 0");
      Assert.That(resultsObject.lastOzasmtImportFileSize > 0, "lastOzasmtImportFileSize = 0");*/
  }
Beispiel #2
0
 private void addTask_ImportFile(string fileToImport, Control flowLayoutPanel)
 {
     var newTask = new Task_LoadAssessmentFiles(new O2AssessmentLoad_OunceV6(), fileToImport);
     newTask.onTaskStatusChange += (task, taskStatus) =>
                                       {
                                           if (taskStatus == TaskStatus.Completed_OK &&
                                               task.resultsObject is O2Assessment)
                                           {
                                               importedO2AssessmentFiles.Add(
                                                   (O2Assessment) task.resultsObject);
                                               refreshTreeViewWithCurrentImportedFiles();
                                           }
                                       };
     addTaskToControlAndStartIt(newTask, flowLayoutPanel);
 }
 public void Test_UsingLocalllyCreatedOzamstFile()
 {
     string sourceFile = MockObjects_Ozasmt.getOzasmtXmlFile();
     var task = new Task_LoadAssessmentFiles(new O2AssessmentLoad_OunceV6(),sourceFile);
     Assert.That(task.execute(), "Task execution failed");
 }