Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2007, 06:31 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unit Testing

I am confused on unit testing from "Professional XNA Game Programming" book. For example, how do I do unit testing on "Racing Game Simple"?
  #2 (permalink)  
Old May 3rd, 2007, 07:40 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

You can either use TestDriven.NET or NUnit and start all dynamic unit tests from the assembly, which is not all that exciting.

OR you can start the much more exciting static unit tests directly from the UnitTests.cs file, just uncomment the line you want to test and press F5 to start the game. Alternatively you can also start unit tests from the command line, e.g. "RacingGameSimple.exe -TestCarModel" will show the car model from the game in a special unit test or "RacingGameSimple.exe -TestRenderTrack" will show the track generation code from, etc.

For more information read the end of Chapter 14 or just take a look into UnitTests.cs

http://abi.exdream.com
  #3 (permalink)  
Old May 4th, 2007, 04:27 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that there's a problem with the VC# IDE. The drop-down listbox that says "Debug", "Release", and "Configuration Manager" is grayed out and I can't choose "Debug". I think that I need to use "Debug" for unit testing. When I try to use unit testing, the game starts normally and when I exit the game, I get an empty game window with light gray background and the only way to exit the game is to call up the Task Manager and terminate the game.
  #4 (permalink)  
Old May 4th, 2007, 07:36 AM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

Ohh I see. You can enable the DEBUG define in the project properties window in Visual C# Express. Just right click on your project, select Properties and go the the Build screen. There you can enable debugging yourself (even if there is no Release/Debug Configuration Option available where it would be in VS 2005).

BTW: Some of the projects have a release/debug configuration just because I created them in VS 2005 and then just continued working in Visual C# Express. I guess this can also be fixed by adding something to the .vsproj file (just compare them where it works and where it does not work).

http://abi.exdream.com
  #5 (permalink)  
Old May 5th, 2007, 04:34 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found out that unit testing worked on 2D games from the book and don't work on 3D games from the book. 2D games usually have two source files and 3D games usually have source files in few folders. I tried to use NUnit on one of the programs generated from XNA but I got "This assembly was not built with any known testing framework" messages.
  #6 (permalink)  
Old May 9th, 2007, 09:34 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To use Nunit or TestDriven.NET I have to use VS2005 and not the Express Edition right?

  #7 (permalink)  
Old May 12th, 2007, 05:50 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

NUnit is an external application, which works fine with XNA Game Studio or Visual C# Express and you can use the NUnitFramework.dll just fine from there.

TestDriven.NET on the other hand is an addon for Visual Studio 2003/2005/Orcas, etc. but from time to time there are versions, which work in the Express version too, just try it out :)

http://abi.exdream.com
  #8 (permalink)  
Old May 14th, 2007, 06:51 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Am I right in thinking it is pretty pointless developing in the full version of VS2005 because the Content pipeline does not work?

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requirement base unit testing elliscnck Assembly Language 0 February 14th, 2008 10:32 AM
Unit Test josericardo_jr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 9th, 2007 08:19 AM
Unit Testing userrob BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 9th, 2005 10:35 AM
Unit Testing XSLT N.Todd XSLT 2 March 1st, 2005 08:31 PM



All times are GMT -4. The time now is 06:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.