-
Notifications
You must be signed in to change notification settings - Fork 157
Assert.Negative
Mikkel Nylander Bundgaard edited this page Jun 13, 2017
·
5 revisions
Asserts that a number is negative.
//true
Assert.Negative(-1);
//false
Assert.Negative(1);
The full set of signatures is
Assert.Negative(int actual);
Assert.Negative(int actual, string message, params object[] args);
Assert.Negative(uint actual);
Assert.Negative(uint actual, string message, params object[] args);
Assert.Negative(long actual);
Assert.Negative(long actual, string message, params object[] args);
Assert.Negative(ulong actual);
Assert.Negative(ulong actual, string message, params object[] args);
Assert.Negative(decimal actual);
Assert.Negative(decimal actual, string message, params object[] args);
Assert.Negative(double actual);
Assert.Negative(double actual, string message, params object[] args);
Assert.Negative(float actual);
Assert.Negative(float actual, string message, params object[] args);
You may also use Assert.That with a Is.Negative constraint to achieve the same result.
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