The reason why the editor freezes is that Assert.ThrowsAync blocks the main editor thread. In general we provide IEnumerator alternatives to such calls, which will work instead, but we do not yet have one for ThrowsAsync. Until we add that in a minor release in the future, you are able to work around the issue by adding similar code. The following snippet will use an UnityTest to check on every frame update if the async method is doen running and once it is done, it will evaluate the exception.
[UnityTest]
public IEnumerator UnityThrowsAsync_WhenCallingAsyncTask_Solution()
{
yield return AssertThrowAsync<Exception>(ThrowException);
}
private IEnumerator AssertThrowAsync<T>(AsyncTestDelegate code) where T : Exception
{
var task = code();
while (!task.IsCompleted)
{
yield return null;
}
Assert.That<Exception>(task.Exception != null && task.Exception.InnerExceptions.Count == 1 ? task.Exception.InnerException : task.Exception, new ExceptionTypeConstraint(typeof(T)));
}