TestLoader.Load fails when run under Unity's web-player
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnitLite |
Fix Released
|
Low
|
Charlie Poole |
Bug Description
Unity's web-player runs in a restricted environment, specifically one where System.
This means that NUnitLite.
public static ITest Load(Assembly assembly)
{
foreach (Type type in assembly.
{
if (IsTestFixture(
}
return suite;
}
private static string GetAssemblyName
{
try
{
}
catch (System.
{
}
return "<assembly>";
}
Related branches
Changed in nunitlite: | |
milestone: | none → 0.7 |
Changed in nunitlite: | |
status: | Fix Committed → Fix Released |
Seems like a reasonable fix for this one case. However, it may be that
we could need
a special build for Unity in the future. I invite you to bring it up
on the nunit-discuss
mailing list if it seems like something we should get into.
Charlie
On Fri, Mar 25, 2011 at 10:06 AM, Damyan Pepper Reflection. Assembly. GetName( ) is not available. See unity3d. com/support/ documentation/ ScriptReference /MonoCompatibil ity.html Runner. TestLoader. Load fails when it tries to GetAssemblyName (assembly) ); GetTypes( )) type)) (Assembly assembly) GetName( ).Name; MethodAccessExc eption) /bugs.launchpad .net/bugs/ 742625
<email address hidden> wrote:
> Public bug reported:
>
> Unity's web-player runs in a restricted environment, specifically one
> where System.
> http://
>
> This means that NUnitLite.
> get the assembly name. Modifying the code to look like this is a
> possible work around:
>
> public static ITest Load(Assembly assembly)
> {
> TestSuite suite = new TestSuite(
>
> foreach (Type type in assembly.
> {
> if (IsTestFixture(
> suite.AddTest(new TestSuite(type));
> }
>
> return suite;
> }
>
> private static string GetAssemblyName
> {
> try
> {
> return assembly.
> }
> catch (System.
> {
> return assembly.FullName;
> }
>
> return "<assembly>";
> }
>
> ** Affects: nunitlite
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of NUnitLite
> Developers, which is the registrant for NUnitLite.
> https:/
>
> Title:
> TestLoader.Load fails when run under Unity's web-player
>