/
Helper.cs
67 lines (56 loc) · 1.47 KB
/
Helper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using NUnit.Framework;
namespace UnitTestImpromptuInterface
{
public class SerializableAttribute : Attribute
{
}
public class Stopwatch
{
private DateTime StartDate;
private DateTime EndDate;
public void Start()
{
StartDate = DateTime.Now;
}
public void Stop()
{
EndDate = DateTime.Now;
}
public TimeSpan Elapsed
{
get { return EndDate - StartDate; }
}
}
public class WriteLineContext
{
public void WriteLine(string format, params object[] args)
{
Console.WriteLine(format, args);
}
}
public class Helper
{
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public WriteLineContext TestContext
{
get { return new WriteLineContext(); }
}
public void AssertException<T>(TestDelegate action) where T:Exception
{
Assert.Throws<T>(action);
}
}
}