sschmid / Entitas-Shmup

Entitas Shmup - An advanced example project to teach how to use Entitas with Unity physics and unit test
https://github.com/sschmid/Entitas-CSharp
76 stars 27 forks source link

Not working with the latest Unity 5.6 #6

Open revanaii opened 7 years ago

revanaii commented 7 years ago

A bunch of errors related to the standard assets and EntityLinkTests class appear.

IsaiahKelly commented 7 years ago

@revanaii I'm currently working on upgrading this project to the latest version of Unity and Entitas. No ETA though. I'm fairly new to Entitas so it's not exactly easy for me. I'll try to keep you posted.

phoenleo commented 7 years ago

Hi, I found solution to make the project working.

First, you can just let Unity update the outdated API using its auto-updater when you open the project for the first time. You can look here for further information Unity API Updater

Then you have to update the NUnit APIs implementation inside the test code. It's in the EntityLinkTests.cs. Due to Unity 5.6 is using NUnit 3, you cannot use the ExcpectedExceptionAttribute. You can check here for NUnit's breaking changes

The easiest way to update the API is by replacing EntityLinkTests.cs:41 with

[Test]
public void ThrowsWhenAlreadyUnlinked() {
  // when
  Assert.Throws<Exception>(() => _link.Unlink());
}

and line 67 with

[Test]
public void ThrowsWhenAlreadyUnlinked() {
   // when
  Assert.Throws<Exception>(() => _link.Unlink());
}