3 private static int DoTest (string type
, string expected
, string actual
, int failcode
)
5 if (!actual
.Equals (expected
)) {
6 System
.Console
.WriteLine ("Bad {0}: Expected {1}, Was {2}",
7 type
, expected
, actual
);
13 public static int Main ()
16 Concrete val
= new Concrete ();
18 failure
|= DoTest ("A", "A", ((A
) val
).Spec
, 0x01);
19 failure
|= DoTest ("B", "B", ((B
) val
).Spec
, 0x02);
20 failure
|= DoTest ("C", "B", ((C
) val
).Spec
, 0x04);
21 failure
|= DoTest ("Concrete", "Concrete", val
.Spec
, 0x08);
34 new string Spec { get; }
43 string A
.Spec { get { return "A"; }
}
44 string B
.Spec { get { return "B"; }
}
45 public string Spec { get { return "Concrete"; }
}