chris carter's web log

Home |  Contact |  Admin
 

More Code Gen Testing

Posted on April 8, 2008

Here's another test:

[Test]
public void VerifyInheritsFrom()
{
  NamespaceDeclaration nsdecl =
    new NamespaceDeclaration("TestContainer");

  nsdecl.AddClass("Manager")
    .InheritsFrom(nsdecl.AddClass("Employee"));

  using (DomTester dom = new DomTester(nsdecl))
  {
    Assert.IsTrue(dom.Type("Manager").InheritsFrom("Employee"));
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

That snippet tests the compiled version of the following source that was generated:

Comments

Post a Comment

(required)
(required)
(no HTML!)