-
Notifications
You must be signed in to change notification settings - Fork 155
Assert.Positive
Mikkel Nylander Bundgaard edited this page Jun 13, 2017
·
6 revisions
Asserts that a number is positive.
//false
Assert.Positive(-1);
//true
Assert.Positive(1);
All the overloads of the method are
Assert.Positive(int actual)
Assert.Positive(int actual, string message, params object[] args)
Assert.Positive(uint actual)
Assert.Positive(uint actual, string message, params object[] args)
Assert.Positive(long actual)
Assert.Positive(long actual, string message, params object[] args)
Assert.Positive(ulong actual)
Assert.Positive(ulong actual, string message, params object[] args)
Assert.Positive(decimal actual)
Assert.Positive(decimal actual, string message, params object[] args)
Assert.Positive(double actual)
Assert.Positive(double actual, string message, params object[] args)
Assert.Positive(float actual)
Assert.Positive(float actual, string message, params object[] args)
You may also use Assert.That with a Is.Positive 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