FileNotFound Exception when using TestDriven.NET and NUnit

Posted by Quang Anh on Stack Overflow See other posts from Stack Overflow or by Quang Anh
Published on 2010-06-07T07:04:09Z Indexed on 2010/06/07 7:12 UTC
Read the original article Hit count: 345

I'm Writing a simple pong game in C# and XNA 4.0 to learn unit testing. The tools used are TestDriven.NET and NUnit, all newest versions. The problem is, if I test the code with VS2010 internal debugger, everything runs fine, but when I use "Run Test(s)" from menu, the application chokes with error:

Test 'WindowsGame1.Game1.TestGameMenu' failed: Microsoft.Xna.Framework.Content.ContentLoadException : Error loading "SpaceBackground". File not found.
----> System.IO.FileNotFoundException : Error loading "Content\SpaceBackground.xnb". File not found.
(some more below...)

So it stops when the first textre is going to be loaded. What's going on?

If you want to check the code out, download it here http://www.mediafire.com/?qwnkmyqheum

© Stack Overflow or respective owner

Related posts about c#

Related posts about unit-testing