HEllo,

I have a few issues with my unit tests (or project organization).
I am on Mac, using Mono 2.6.7; NPanday VErsion: 1.4.0-incubating.

Ok, here we go:
In my project I am having an internal class (to not expose it).
However I need to unit test these classes too.

A simplified version of my project is located here:
https://github.com/matzew/npanday-demo

Now compiling the project gives me this obvious error:

  [INFO] 
/Users/matzew/Work/Github/npanday-projects/test-case/target/build-test-sources/Test/MyAppTest.cs(36,12):
error CS0122: `Sample.MyApp' is inaccessible due to its protection
level

Ok, so far so good; According to [1] and [2] (and similar blog posts)
this can be solved by adding the "InternalsVisibleTo" attribute to the
AssemblyInfo.cs file.

Doing so, gives me this error:
  [INFO] 
/Users/matzew/Work/Github/npanday-projects/test-case/target/build-test-sources/Test/MyAppTest.cs(36,12):
error CS0246: The type or namespace name `MyApp' could not be found.
Are you missing a using directive or an assembly reference?

Now it looks like that it even doesn't see the "Sample.MyApp"
class/namespace any more.

I explicitly configured the "pom.xml" file to include my AssemblyInfo.cs file:
https://github.com/matzew/npanday-demo/blob/master/pom.xml

But looks like that NPanday/Mono does not like the content of the
"InternalsVisibleTo" attribute of my AssemblyInfo.cs file:
https://github.com/matzew/npanday-demo/blob/master/Properties/AssemblyInfo.cs


Honestly, I am not sure what's the issue, and how to solve it.

I am wondering if there are any naming conflicts (e.g. with the Assembly Names)?

Are there ways to specify a name for the test assemblies?
==> It looks like now the Mono env. does not find "Sample.MyApp" anymore...

Is the structure of this project fine for dotnet projects (in Java
land it's the case)?
Since the project is generating two assemblies the "real" dll, and the
"test" dll.

Any pointer is totally appreciated..

Thanks in advice!

Greetings,
Matthias

[1] 
http://www.davidarno.org/c-howtos/friend-assemblies-accessing-internal-classes-externally/
[2] http://www.sturmnet.org/blog/2005/05/10/internalsvisibleto-sn



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Reply via email to