Пример #1
0
 public TestRunCoordinator(DateTime testRunStarted)
 {
     TestRunStarted = testRunStarted;
     TestRunData = new TestRunTree(testRunStarted.Ticks);
     Subscribers = new List<IActorRef>();
     SetReceive();
 }
 protected override void HandleTestRunTree(TestRunTree tree)
 {
     var passedSpecs = tree.Specs.Count(x => x.Passed.GetValueOrDefault(false));
     WriteSpecMessage(string.Format("Test run completed in [{0}] with {1}/{2} specs passed.", tree.Elapsed, passedSpecs, tree.Specs.Count()));
     foreach (var factData in tree.Specs)
     {
         PrintSpecRunResults(factData);
     }
 }
Пример #3
0
        public bool SaveTestRun(string filePath, TestRunTree data)
        {
            var template = new VisualizerRuntimeTemplate { Tree = data };
            var content = template.TransformText();
            var fullPath = Path.GetFullPath(filePath);
            File.WriteAllText(fullPath, content);

            return true;
        }
 protected override void HandleTestRunTree(TestRunTree tree)
 {
     Console.WriteLine("Writing test state to: {0}", Path.GetFullPath(FileName));
     try
     {
         FileStore.SaveTestRun(FileName, tree);
     }
     catch (Exception ex) //avoid throwing exception back to parent - just continue
     {
         Console.WriteLine("Failed to write test state to {0}. Cause: {1}", Path.GetFullPath(FileName), ex);
     }
     Console.WriteLine("Finished.");
 }
        public bool SaveTestRun(string filePath, TestRunTree data)
        {
            Guard.Assert(data != null, "TestRunTree must not be null.");
            Guard.Assert(!string.IsNullOrEmpty(filePath), "filePath must not be null or empty");


// ReSharper disable once AssignNullToNotNullAttribute //already made this null check with Guard
            var finalPath = Path.GetFullPath(filePath);
            var serializedObj = JsonConvert.SerializeObject(data, Formatting.Indented, Settings);

// ReSharper disable once AssignNullToNotNullAttribute
            File.WriteAllText(finalPath, serializedObj, Encoding.UTF8);

            return true;
        }
Пример #6
0
        public bool SaveTestRun(string filePath, TestRunTree data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            if (string.IsNullOrEmpty(filePath))
            {
                throw new ArgumentException("filePath must not be null or empty");
            }


// ReSharper disable once AssignNullToNotNullAttribute //already made this null check with Guard
            var finalPath     = Path.GetFullPath(filePath);
            var serializedObj = JsonConvert.SerializeObject(data, Formatting.Indented, Settings);

// ReSharper disable once AssignNullToNotNullAttribute
            File.WriteAllText(finalPath, serializedObj, Encoding.UTF8);

            return(true);
        }
 protected override void HandleTestRunTree(TestRunTree tree)
 {
     if (_reportStatus)
     {
         Console.WriteLine("Writing test state to: {0}", Path.GetFullPath(FileName));
     }
     try
     {
         FileStore.SaveTestRun(FileName, tree);
     }
     catch (Exception ex) //avoid throwing exception back to parent - just continue
     {
         if (_reportStatus)
         {
             Console.WriteLine("Failed to write test state to {0}. Cause: {1}", Path.GetFullPath(FileName), ex);
         }
     }
     if (_reportStatus)
     {
         Console.WriteLine("Finished.");
     }
 }
Пример #8
0
 protected override void HandleTestRunTree(TestRunTree tree)
 {
 }
Пример #9
0
 public BeginSinkTerminate(TestRunTree testRun, IActorRef subscriber)
 {
     Subscriber = subscriber;
     TestRun    = testRun;
 }
Пример #10
0
 protected abstract void HandleTestRunTree(TestRunTree tree);
 protected override void HandleTestRunTree(TestRunTree tree)
 {
     Console.WriteLine("Writing test state to: {0}", Path.GetFullPath(FileName));
     FileStore.SaveTestRun(FileName, tree);
 }
Пример #12
0
 public BeginSinkTerminate(TestRunTree testRun, IActorRef subscriber)
 {
     Subscriber = subscriber;
     TestRun = testRun;
 }
Пример #13
0
 protected abstract void HandleTestRunTree(TestRunTree tree);
Пример #14
0
 private static bool TestRunPassed(TestRunTree tree)
 {
     return tree.Specs.All(x => x.Passed.HasValue && x.Passed.Value);
 }
 protected override void HandleTestRunTree(TestRunTree tree)
 {
     Console.WriteLine("Writing test state to: {0}", Path.GetFullPath(FileName));
     FileStore.SaveTestRun(FileName, tree);
 }