-
Notifications
You must be signed in to change notification settings - Fork 156
Classic Model
jnm2 edited this page Mar 18, 2017
·
9 revisions
The classic Assert model uses a separate method to express each individual assertion of which it is capable.
Here's a simple assert using the classic model:
StringAssert.AreEqualIgnoringCase( "Hello", myString );
The Assert class provides the most common assertions in NUnit:
- Assert.True
- Assert.False
- Assert.Null
- Assert.NotNull
- Assert.IsNaN
- Assert.IsEmpty
- Assert.IsNotEmpty
- Assert.AreEqual
- Assert.AreNotEqual
- Assert.AreSame
- Assert.AreNotSame
- Assert.Contains
- Assert.Greater
- Assert.GreaterOrEqual
- Assert.Less
- Assert.LessOrEqual
- Assert.IsInstanceOf
- Assert.IsNotInstanceOf
- Assert.IsAssignableFrom
- Assert.IsNotAssignableFrom
- Assert.Throws
- Assert.ThrowsAsync
- Assert.DoesNotThrow
- Assert.DoesNotThrowAsync
- Assert.Catch
- Assert.CatchAsync
- Assert.Pass
- Assert.Fail
- Assert.Ignore
- Assert.Inconclusive
Additional assertions are provided by the following classes:
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers