Rank: Newbie
Groups: Registered
Joined: 5/31/2011(UTC) Posts: 4 Location: Germany
Thanks: 1 times
|
I am testing this method: Code:
public static Base<T> Create(string typeName, string assemblyName) where T : class
{
string name = string.Format(
CultureInfo.InvariantCulture, "{0}`1[[{1}]], {2}", typeName, typeof(T), assemblyName);
Type type = Type.GetType(name, true);
return new Derived<T>((BaseImpl<T>)type.GetProperty("Instance").GetValue(null, null));
}
This test succeeds with NUnit but fails with NCrunch: Code:
[Test]
[ExpectedException(typeof(FileNotFoundException))]
public void Create_throws_FileNotFoundException_if_assembly_can_not_be_found()
{
using (Factory.Create<string>(this.typeName, "This.File.Does.Not.Exist"))
{
}
}
Ncrunch expects a FileLoadException but the assembly does not exist??
|