AspectSharp.Tests.MixinTests.MixinTestCase.MakeAuthorAPersonAndACustomer C# (CSharp) Method

MakeAuthorAPersonAndACustomer() private method

private MakeAuthorAPersonAndACustomer ( ) : void
return void
		public void MakeAuthorAPersonAndACustomer()
		{
			String contents = "import AspectSharp.Tests.Classes in AspectSharp.Tests " + 
				" " + 
				" aspect McBrother for Author " + 
				"   " + 
				"   include DummyCustomer" + 
				"   include DummyPerson" + 
				"   " + 
				" end ";

			AspectEngineBuilder builder = new AspectLanguageEngineBuilder(contents);
			AspectEngine engine = builder.Build();

			Author author = engine.WrapClass(typeof(Author)) as Author;
			Assert.IsNotNull(author);
			Assert.IsNotNull(author as ICustomer);
			Assert.IsNotNull(author as IPerson);

			ICustomer customer = author as ICustomer;
			customer.CustomerId = 10;
			Assert.AreEqual( 10, customer.CustomerId );

			IPerson person = author as IPerson;
			person.Name = "Billy Paul McKinsky";
			Assert.AreEqual( 10, customer.CustomerId );

			Assert.AreEqual( 0, author.BooksPublished );
			author.MoreOneBook();
			Assert.AreEqual( 1, author.BooksPublished );
		}