locked
Running Unit tests on XBox 360 RRS feed

  • Question

  • Calling all TDD develepors...

    Does anyone know whether it is possible to use NUnit to run unit tests on the XBox 360?

    Thanks
    Thursday, December 21, 2006 3:58 AM

Answers

  • I don't think NUnit would work because it references some assemblies that are not available on the 360 (like System.Windows.Forms)  You could run the tests on Windows though.  I think NUnit can remote test over a network connection, although I don't know if you could load a .dll with unit tests from the 360.  It's a good idea though to ensure that your code works on Win and 360.
    Friday, December 22, 2006 4:00 PM

All replies

  • I have no idea. However, I know that most unit test frameworks add more fat than they're worth. My unit testing looks something like:

    class MyClass {
    #if !FINAL_BUILD
      static MyClassTester tester = new MyClassTester();
      class MyClassTester {
        MyClassTester() {
          system.Diagnostics.Debug.Assert(some test);
          system.Diagnostics.Debug.Assert(some other test);
        }
    #endif
        ....
    }

    That's really all you need. I did all my integration and collision checking tests this way, and it works fine. System.Diagnostics gives you a good backtrace if a unit test fails on start-up, and if nothing fails, you get no output, which is just as good by me :-)

    The draw-back is that unit tests run as part of start-up, not as part of compiling, but I can live with that. Debugging test failures is actually easier that way, anyway.

    Thursday, December 21, 2006 5:56 AM
  • I don't think NUnit would work because it references some assemblies that are not available on the 360 (like System.Windows.Forms)  You could run the tests on Windows though.  I think NUnit can remote test over a network connection, although I don't know if you could load a .dll with unit tests from the 360.  It's a good idea though to ensure that your code works on Win and 360.
    Friday, December 22, 2006 4:00 PM
  • Thanks guys, I have decided to be content with running unit tests on windows only for now.
    Friday, December 29, 2006 1:46 PM
  • What I have been doing is developing 90% in visual studio pro referencing using the assemblies directly. This lets me do everything except deploy. For that I switch back to c# express and do my testing. This means i have two solutions, one for unit tests and general Visual Studio Pro development (with ghostDoc my savior!) and a second xbox solution that has just the project itself.

    I was considering writing a test harness that can be fired up on the 360 and just execute a series of graphics tests using the classes we have written but haven't had the energy or time.

    Barry R.
    Friday, December 29, 2006 2:52 PM