From 7c1e566113d59699af1624186c64eca67f063fc6 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Apr 2020 19:09:33 -0400 Subject: Upgraded Unity --- .../Documentation~/reference-custom-constraints.md | 31 ---------------------- 1 file changed, 31 deletions(-) delete mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-custom-constraints.md (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-custom-constraints.md') diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-custom-constraints.md b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-custom-constraints.md deleted file mode 100644 index bbf4bbb..0000000 --- a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-custom-constraints.md +++ /dev/null @@ -1,31 +0,0 @@ -# Custom constraints - -`NUnit` allows you to write test assertions in a more descriptive and human readable way using the [Assert.That](https://github.com/nunit/docs/wiki/Assertions) mechanism, where the first parameter is an object under test and the second parameter describes conditions that the object has to meet. - -## Is - -We’ve extended `NUnit` API with a custom constraint type and declared an overlay `Is` class. To resolve ambiguity between the original implementation and the custom one you must explicitly declare it with a using statement or via addressing through the full type name `UnityEngine.TestTools.Constraints.Is`. - -### Static Methods - -| Syntax | Description | -| -------------------- | ------------------------------------------------------------ | -| `AllocatingGCMemory` | A constraint type that invokes the delegate you provide as the parameter of `Assert.That` and checks whether it causes any GC memory allocations. It passes if any GC memory is allocated and fails if not. | - -## Example - -```c# -using Is = UnityEngine.TestTools.Constraints.Is; - -class MyTestClass -{ - [Test] - public void MyTest() - { - Assert.That(() => { - var i = new int[500]; - }, Is.AllocatingGCMemory()); - } -} -``` - -- cgit v1.2.3