我正在用 C# 和 XNA 4.0 编写一个简单的乒乓球游戏来学习单元测试。使用的工具是 TestDriven.NET 和 NUnit,都是最新版本。问题是,如果我使用 VS2010 内部调试器测试代码,一切运行正常,但是当我从菜单中使用“运行测试”时,应用程序因错误而窒息:
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...)
因此,当要加载第一个 textre 时它会停止。这是怎么回事?
如果您想查看代码,请在此处下载http://www.mediafire.com/?qwnkmyqheum