thelinuxlich / artemis_CSharp

Artemis Entity System Framework ported to C#
Other
341 stars 78 forks source link

Aspect unit tests #74

Closed Maximusya closed 10 years ago

Maximusya commented 10 years ago

Implemented base unit tests in order to cover recently discovered issue #73

While writing the tests, I first assumed that empty Entity (i.e. no components) is subject to Aspect.Empty, but failed test and subsequent research convinced me of the opposite - thus I updated relevant xml docs and added a note for the test to clarify Aspect.Empty purpose.

Note that I omitted any "invalid arguments" tests such as null Entity: Debug.Assert already describes methods' contracts.

Maximusya commented 10 years ago

Added Aspect unit tests calls to Program.cs - but do we really need this self-made console test runner? Nunit has it's own, Mstest too. New Visual Studios even come with "universal" test runner: vstest.console.exe. Resharper, NCrunch etc - for testing during development.

thelinuxlich commented 10 years ago

I think we're testing it this way because of Travis CI

Maximusya commented 10 years ago

Travis CI runs NUnit test runner over ArtemisMonoUnitTests.dll:

xbuild Artemis_Mono/Artemis_Mono.sln nunit-console Artemis_Mono/bin/Debug/ArtemisMonoUnitTests.dll

Thus Program.Main is not executed - just the methods marked with [Test] attribute. So my guess - Program.cs is a convinience method to run tests during development in some limited environments without any test runners installed into IDE or OS.