3 * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors.
4 * See the included file named LICENSE for license information.
11 public class WvTestTest
13 [Test] public void test_wvtest()
25 WVPASSEQ("foo", "foo");
27 Object obj = new Object();
32 WVPASSNE("foo", "blue");
33 WVPASSNE("", "notempty");
36 WVPASSNE(obj, new Object());
37 WVPASSNE(new Object(), new Object());
40 // these are only public to get rid of the "not assigned to" warnings.
41 // we don't assign to them because that's the whole point of the test.
42 public DateTime null_date;
43 public TimeSpan null_span;
45 [Test] public void test_dates_and_spans()
47 WVPASS(null_date == DateTime.MinValue);
48 WVPASSEQ(null_date, DateTime.MinValue);
49 WVPASS(null_span == TimeSpan.Zero);
50 WVPASSEQ(null_span, TimeSpan.Zero);
52 TimeSpan t = TimeSpan.FromMinutes(60*24*7);
53 WVPASSEQ(t.ToString(), "7.00:00:00");
54 WVPASSEQ(t.Ticks, 7*24*60*60*10000000L);
55 WVPASS(t.TotalMinutes == 7*24*60);
56 WVPASSEQ(t.TotalMinutes, 7*24*60);
57 WVPASSEQ(t.TotalSeconds, 7*24*60*60);
58 WVPASSEQ(t.Minutes, 0);
61 void throw_exception()
63 throw new System.Exception("Exception thrown");
65 void no_throw_exception()
70 [Test] public void test_exceptions()
75 WVEXCEPT(throw_exception());
76 } catch (Wv.Test.WvAssertionFailure e) {
78 } catch (System.Exception) {
86 System.Console.WriteLine("Ignore next failure: it is expected");
87 WvTest.expect_next_failure();
89 WVEXCEPT(no_throw_exception());
90 } catch (Wv.Test.WvAssertionFailure) {