From: Mike R. <mik...@us...> - 2005-03-07 05:46:20
|
Update of /cvsroot/netreflector/NetReflector/src/NetReflector.Test/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21723/src/NetReflector.Test/Util Added Files: DefaultInstantiatorTest.cs Removed Files: ReflectionUtilTest.cs Log Message: Allowing Custom Instantiators to be used (used by CruiseControl.NET's Web Dashboard project) --- NEW FILE: DefaultInstantiatorTest.cs --- using Exortech.NetReflector.Util; using NUnit.Framework; using System; namespace Exortech.NetReflector.Test.Util { [TestFixture] public class DefaultInstantiatorTest { private DefaultInstantiator instantiator; [SetUp] public void Setup() { instantiator = new DefaultInstantiator(); } public void IsCommonType() { Assert.IsTrue(ReflectionUtil.IsCommonType(typeof(string)), "String member should be common type"); Assert.IsTrue(ReflectionUtil.IsCommonType(typeof(int)), "int should be common type"); Assert.IsTrue(ReflectionUtil.IsCommonType(typeof(DateTime)), "DateTime should be common type"); Assert.IsTrue(ReflectionUtil.IsCommonType(typeof(ReflectorMemberTest.TestEnum)), "Enum should be common type"); } [Test] public void CreateInstance() { TestClass testClass = (TestClass)instantiator.Instantiate(typeof(TestClass)); Assert.IsNotNull(testClass); } [Test, ExpectedException(typeof(NetReflectorException))] public void CreateInstanceWithUnknownType() { instantiator.Instantiate(typeof(string)); } } } --- ReflectionUtilTest.cs DELETED --- |