I’d like to create an assertion that works like the built in assertions.
For example:
Assert.AreNear(vectorA, vectorB, 0.01f); // doesn't exist
Right now I have to write it like this:
Assert.Less((vectorA - vectorB).magnitude, 0.01f); // readability is bad for complicated tests
I could define my own wrappers for Assert in some CustomAssertClass like this:
CustomAssertClass.AreNear(vectorA, vectorB, 0.01f); // editor brings you to the wrong spot
but when you click on a failed assertion from the editor, it doesn’t bring you to the test, it brings you to the CustomAssertClass, which is a pain in the butt.
Is there a clean way to extend the Assertions?