-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GD-8: Add generic
VectorAssert
to support all Godot Vector types
# Why We want to have one assert for all Godot vector types, actual we have only covered Vector2 and Vector3 # What - Removed the interfaces and implementations for Vector2 and Vector3 - Introduced IVectorAssert<T> and implementation - make the old asserts as deprecated. - removed the custom float and vector format - set explicit the culture to "en-us" to get expected failure messages in english notation - fix test name generation to use culture to "en-us" for parameter formattings
- Loading branch information
Nullpointer
committed
Feb 29, 2024
1 parent
bd8e300
commit c6deba8
Showing
12 changed files
with
450 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
namespace GdUnit4.Asserts; | ||
using System; | ||
|
||
/// <summary> An Assertion tool to verify Godot.Vector values </summary> | ||
public interface IVectorAssert<T> : IAssertBase<T> where T : IEquatable<T> | ||
{ | ||
/// <summary> | ||
/// Verifies that the current value is equal to expected one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public new IVectorAssert<T> IsEqual(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is not equal to expected one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public new IVectorAssert<T> IsNotEqual(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current and expected value are approximately equal. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <param name="approx">The approximal value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsEqualApprox(T expected, T approx); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is less than the given one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsLess(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is less than or equal the given one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsLessEqual(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is greater than the given one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsGreater(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is greater than or equal the given one. | ||
/// </summary> | ||
/// <param name="expected">The expected value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsGreaterEqual(T expected); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is between the given boundaries (inclusive). | ||
/// </summary> | ||
/// <param name="min">The minimal value</param> | ||
/// <param name="max">The maximal value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsBetween(T min, T max); | ||
|
||
/// <summary> | ||
/// Verifies that the current value is not between the given boundaries (inclusive). | ||
/// </summary> | ||
/// <param name="min">The minimal value</param> | ||
/// <param name="max">The maximal value</param> | ||
/// <returns>IVectorAssert</returns> | ||
public IVectorAssert<T> IsNotBetween(T min, T max); | ||
|
||
/// <summary> | ||
/// Overrides the default failure message by given custom message. | ||
/// </summary> | ||
/// <param name="message">The message to replace the default message</param> | ||
/// <returns>IVectorAssert</returns> | ||
new IVectorAssert<T> OverrideFailureMessage(string message); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.