Commit 1377265
Changed files (2)
product
tests
product/tests/test.cs
@@ -1,17 +1,18 @@
+using System;
using System.Collections.Generic;
using NUnit.Framework;
using tests.unit;
-namespace tests
-{
- public delegate void it();
+public delegate void it();
- public delegate void because();
+public delegate void because();
- public delegate void context();
+public delegate void context();
- public delegate void after_all();
+public delegate void after_all();
+namespace tests
+{
public abstract class test
{
IDictionary<string, it> tests = new Dictionary<string, it>();
@@ -22,6 +23,8 @@ namespace tests
{
context();
because();
+ Console.Out.WriteLine();
+ Console.Out.WriteLine(GetType().Name);
}
[Test]
@@ -29,7 +32,7 @@ namespace tests
{
GetType().run_all<it>(this);
tests.each(test => test.run());
- GetType().run_all<after_all>(this);
+ GetType().run_single<after_all>(this);
}
protected void it(string should, it test)
product/tests/TestRunner.cs
@@ -35,12 +35,12 @@ namespace tests
{
try
{
- Console.Out.Write("{0}", x);
x.invoke_delegate_on(target_instance);
- Console.Out.WriteLine(" :PASSED");
+ Console.Out.WriteLine(" {0}", x);
}
catch (Exception e)
{
+ Console.Out.WriteLine(":FAILED {0}", x);
throw e.InnerException;
}
});
@@ -50,13 +50,12 @@ namespace tests
{
try
{
- Console.Out.Write("it {0}", specification.Key);
specification.Value();
- Console.Out.WriteLine(" :PASSED");
+ Console.Out.WriteLine(" it {0}", specification.Key);
}
catch
{
- Console.Out.WriteLine(" :FAILED");
+ Console.Out.WriteLine(":FAILED it {0}", specification.Key);
throw;
}
}