Geeks With Blogs

@jolson88
  • jolson88 You know, for supposedly being in the post-PC era, I'm seeing a lot of tweets about the new Mac in my Twitter feed. #fb about 501 days ago
  • jolson88 @Anyware I find the difference in perception fascinating (and frustrating). about 504 days ago
  • jolson88 @Anyware Agreed. I've often wondered whether apps like yours can do well in freemium. about 504 days ago
  • jolson88 @Anyware Curious, have you tried an ad-driven freemium approach? about 504 days ago
  • jolson88 @Anyware Thx for the write-up! You know, I've been curious how well the freemium model would work outside of games... about 504 days ago

News

Series

Add to Technorati Favorites


An Archived Managed World This blog has moved to http://www.managed-world.com/blog

I was rather surprised when I ran into this issue earlier this evening and wasn't able to find anything on Google about it. So, I'm going to post this on my blog in case it happens for anyone else or in case it happens to me again and I forget about it.

After I installed XP SP2 last night on my development machine here at home, I decided to get back to development on my projects for Managed World. Well, when I went to write some more unit tests (I'm using test-driven development for a good number of my personal projects), TestDriven.NET was simply reporting “----Done----” without running tests. When I opened my testing assembly in the NUnit GUI, NUnit was reporting that the assembly contained no TestFixtures. Neither NUnit or TestDriven.NET was reporting any errors.

After some investigation, I discovered the issue had nothing to do with the upgrade to Windows XP. The issue had to deal with the default security permissions I had configured for the assembly. Most of you out there that use FxCop are aware that there is a rule where you need to specify the minimum required permissions for an assembly. Well, for my testing assembly I had declared that the FileIOPermission for write access to the C:\ drive was optional, not required, as such:

[assembly: FileIOPermission(SecurityAction.RequestOptional, Write="C:\\")]

Well, that was the primary cause of my problem. When I commented out the permission set or changed it from RequestOptional to RequestMinimum, than NUnit worked again. What surprised me was that NUnit did not throw an error or providing any sort of clue that there was a permissions error. Interesting.

So, note to self: investigate the minimum permissions required for assemblies being analyzed by certain .NET tools like FxCop and NUnit.

Posted on Sunday, January 23, 2005 9:43 PM | Back to top


Comments on this post: NUnit falsely reports "'Assembly Name' has no TestFixtures"

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
hi there,

this is actually not an answer to your post... but i didn't find a better way to ask you, when your project >>Writing A 2D Game with Managed DirectX<< will get a new update?

I like the series of articles because you do actually explain, why you are doing things the way you do them. And rewriting the stuff in vb.net makes sure I do understand...

For me as a kind of 'beginner' to programming with .net and directX there is no better source on the net --> that I have found jet :-)

Soooo - don't let us wait...

Greetings from Germany

Left by Patric on Jan 25, 2005 4:50 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Patric,

Now that all the rough seas have calmed down after getting a new job, I've been able to make excellent progress on the game. The articles will actually be re-written and moved to my gaming site, http://www.managed-world.com. I just have my Input Manager and State Manager to finish before I can crank out a couple of more articles in the series. I'm aiming at next week to really start writing the articles (and the articles shouldn't take longer than a week to write). So, expect the next couple of updates in the coming week or two.

Sorry for such a long delay. I know personally that there's not much more frustrating than finding a good resource that is largely incomplete. Stay in there!!
Left by Jason Olson on Jan 25, 2005 10:24 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Jason,

Thanks for posting about this. I also have experienced this problem and wrote my own blog about it:

http://www.robertbullen.com/codeslinger/2005/02/nunit-dislikes-optional-security.html
Left by Robert Bullen on Feb 15, 2005 2:07 PM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
I am getting a similar error.....Has No TextFixture. But then i have no such permission problem i guess. I never found the line below in my assembly.

[assembly: FileIOPermission(SecurityAction.RequestOptional, Write="C:\\")]

I wonder why do i still get that error
Left by Deana on May 09, 2005 3:02 PM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Deana,
I encountered the same problem.
I'd finally found out that because of I have multi copy of nunit.framework.dll in my disk, and I changed my project to ref the copy which nunit.gui.exe use. Then nunit worked.
Hope to be helpful!

Lostown@hotmail.com
Left by Roshion on Jun 05, 2005 8:31 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
I also had this problem, but it was because the project was on a network mapped drive. I know you can't debug over the network, but I kind of expected unit tests to work.
Left by Neil on Oct 15, 2005 2:48 PM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Thanks.
I get the same error when I try and load a DLL that's on another server, again it's the security thing you mentioned.
Left by Murray on Nov 22, 2005 2:07 PM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Hello,

Same problem to me: no Test Fixtures
I had my project on D:\ and my NUnit 2.2.5 was on C:
So I moved my project to C:\ and is working.
Left by Catalin on Dec 29, 2005 3:41 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
It seems, it also helps if you do like this:

namespace LinesOfGoal.nunit
{
[TestFixture]
public class PlayFieldTest
.....

You have to do it public!
Left by Catalin on Dec 29, 2005 4:29 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
What a silly mistake.
My class wasn't public.
Thanks Catalin
Left by kaymyst on Mar 21, 2006 3:21 AM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
Wow... defining the class as public is a real good idea! Thanks, I apparently would have NEVER thought of that...as I've been go around in circles for hours trying to figure out why my testes weren't working. Add in "public" on the test class, and BAM, everything magically works.

Yay! [Sigh]
Ted
Left by Ted on Sep 01, 2006 1:53 PM

# re: NUnit falsely reports "'Assembly Name' has no TestFixtures"
Requesting Gravatar...
public class works for me thanks
Left by satyajit on Jan 29, 2007 2:57 PM

Your comment:
 (will show your gravatar)
 


Copyright © Jason Olson | Powered by: GeeksWithBlogs.net | Join free