diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-20 19:09:33 -0400 |
| commit | 7c1e566113d59699af1624186c64eca67f063fc6 (patch) | |
| tree | 5a6850a695986872d5d0b09d7dab8421628fe33e /Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md | |
| parent | dd117b77aae1d8be7563b360d05b842a73b7dab2 (diff) | |
| download | Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.gz Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.tar.bz2 Project-Sandbox-7c1e566113d59699af1624186c64eca67f063fc6.zip | |
Upgraded Unity
Diffstat (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md')
| -rw-r--r-- | Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md deleted file mode 100644 index 8118fd6..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-comparer-float.md +++ /dev/null @@ -1,46 +0,0 @@ -# FloatEqualityComparer
-
-Use this class to compare two float values for equality with [NUnit](http://www.nunit.org/) constraints. Use `FloatEqualityComparer.Instance` comparer to have the default error value set to 0.0001f. For any other error, use the [one argument constructor](#constructors) to create a comparer.
-
-## Static Properties
-
-| Syntax | Description |
-| ---------- | ------------------------------------------------------------ |
-| `Instance` | A singleton instance of the comparer with a default error value set to 0.0001f. |
-
-## Constructors
-
-| Syntax | Description |
-| ------------------------------------------- | ------------------------------------------------------------ |
-| `FloatEqualityComparer(float allowedError)` | Creates an instance of the comparer with a custom error value. |
-
-## Public methods
-
-| Syntax | Description |
-| -------------------------------------------- | ------------------------------------------------------------ |
-| `bool Equals(float expected, float actual);` | Compares the `actual` and `expected` float values for equality using `Utils.AreFloatsEqual`. |
-
-## Example
-
-```c#
-[TestFixture]
-public class FloatsTest
-{
- [Test]
- public void VerifyThat_TwoFloatsAreEqual()
- {
- var comparer = new FloatEqualityComparer(10e-6f);
- var actual = -0.00009f;
- var expected = 0.00009f;
-
- Assert.That(actual, Is.EqualTo(expected).Using(comparer));
-
- // Default relative error 0.0001f
- actual = 10e-8f;
- expected = 0f;
-
- Assert.That(actual, Is.EqualTo(expected).Using(FloatEqualityComparer.Instance));
- }
-}
-```
-
|
