knealz / sharpunit Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mgants4/sharpunit
Unit testing framework for Unity3D in C#
License: Other
This project forked from mgants4/sharpunit
Unit testing framework for Unity3D in C#
License: Other
25 Nov 2013 Keith Neal | [email protected] Modification of Mark's Framework to handle some of our specific use cases 20 May 2010 Mark Gants | [email protected] SharpUnit is a unit testing framework written in C# specifically for Unity3D. It was inspired by and adapted from UUnit, which is written in Boo. More info on UUnit can be found here: http://www.unifycommunity.com/wiki/index.php?title=SharpUnit Why SharpUnit? - Because NUnit is not so easy to integrate into Unity3D. - UUnit works but, while I personally like Boo, not everyone is familiar/comfortable with programming in Boo. - SharpUnit allows you to trap/expect exceptions, UUnit does not (as of today). - SharpUnit can easily be integrated into Unity3D but is not dependant on the Unity3DEngine namespace. - SharpUnit can easily extended and tested outside of Unity3D and even be used for other purposes. - SharpUnit is straight-forward and easy to use. Getting Started: - The Visual Studio solution contains two projects: SharpUnit and SharpUnitTest - SharpUnit: This is the class library that can be built to a DLL. - SharpUnitTest: This is a console app that runs the unit tests for SharpUnit itself. - The Main() function in Program.cs is an example test runner, it illustrates how to get up and running with SharpUnit. - The Unity3D_SharpUnitDemo.zip file contains an actual Unity3D 2.6 project using SharpUnit. Integrate with Unity3D Using a DLL: - Build the SharpUnit.dll from source using Visual Studio. - Create a folder named "SharpUnit" In your Unity3D project's "Assets" folder. - Place the SharpUnit.dll in this folder. - Copy the Unity3D_TestRunner.cs and Unity3D_TestReporter.cs files to this folder. Integrate with Unity3D Using the Scripts: - Create a folder named "SharpUnit" In your Unity3D project's "Assets" folder. - Copy the SharpUnit class files (*.cs) to this folder. - Copy the Unity3D_TestRunner.cs and Unity3D_TestReporter.cs files to this folder. Running Tests in Unity3D: - Create an empty GameObject within Unity, name it TestRunner. - Drag the Unity3D_TestRunner.cs script onto the TestRunner game object. - Write unit test scripts as classes derived from the TestCase class. - Configure the TestSuite object in the Unity3D_TestRunner.cs script to run your tests. - Press Play, you should see the test output in the Unity3D editor console. Extending SharpUnit: - Derive a new class from TestReporter to modify how SharpUnit reports test results and errors. Tips & Tricks: - Depending on your project and how you write your tests, you might notice that SharpUnit can leave "extra" or "duplicate" objects in your scene. This tends to happen if you don't clean up after your tests in the "tear down" methods or if you make use of automatic Singletons, etc. To mitigate this, consider opening a fresh scene before you run the unit tests and close it after the tests have run. I recommend automating this with a static method labeled as a Unity editor "menu item." Works well when running tests in the editor or as part of of your build process as it keeps your scenes free of extra test artifacts that may appear. More on menu items: http://unity3d.com/support/documentation/ScriptReference/MenuItem.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.