Hi all,
A little bit of information relating to the Test Driven Development content for this section of the course.
This section used an asset from the Unity Asset Store called Unity Test Tools. During 2017 this asset was removed, and as such, the directions within a lecture, preceding Making Your First Test Pass, to install this asset were no longer possible and the lecture was removed.
Unfortunately, the removed lecture, which covered the installation of the Unity Test Tools asset, also demonstrated the creation of a very basic test script, ScoreMasterTest.cs and it being run within Unity. Remnants of this are visible in the lecture, Making Your First Test Pass where, at 00:21, you can see a pane on the right-hand side of the screen named Unit Tests. This is the output from the very basic test script that was created in the removed lecture.
At 01:08 you can see Ben browses into the Editor folder within Assets to access the ScoreMasterTest.cs script. The Editor folder is a special folder, when scripts are placed in it they are treated as Editor scripts rather than runtime scripts and enable additional functionality to be added to the Unity editor.
At this point in the course, you will not have the Unity Test Tools asset, or the script created in the removed lecture, to work around this issue, for the time being, you can perform the following steps;
- Take a backup of your project
- Upgrade to Unity 5.6 / 2017 - this will provide Unity’s Test Runner functionality
- Create a new folder called Editor within the Assets folder
- Create a new script called ScoreMasterTest.cs within the Editor folder
- Replace all of the code within the newly created ScoreMasterTest.cs script with the following;
using System; using System.Collections.Generic; using NUnit.Framework; using UnityEngine; [TestFixture] public class ScoreTest { [Test] public void PassingTest () { Assert.AreEqual (1, 1); } }
- Save the script
- Save the project
Alternatively ScoreMasterTest.zip (316 Bytes) contains the Editor folder and ScoreMasterTest.cs which you can then extract and drag directly into your Assets folder.
You should now be able to continue from 01:08 and follow the steps Ben performs, be aware that the Test Runner pane will look slightly different from the videos but performs the same functionality.
I hope the above is of use and enables you to move forward with the course.
See also;
- Unity - Manual : Unity Test Runner