|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MockByExample.Calculators;
namespace MockByExample.Tests
{
[TestClass]
public class IntExtensionsTests
{
[TestMethod]
public void SameValues()
{
const int value = 10;
var result = value.IsBetween(10, 10);
Assert.IsTrue(result);
}
[TestMethod]
public void BorderCaseTopLevel()
{
const int value = 10;
var result = value.IsBetween(8, 10);
Assert.IsTrue(result);
}
[TestMethod]
public void BorderCaseLowLevel()
{
const int value = 10;
var result = value.IsBetween(10, 11);
Assert.IsTrue(result);
}
[TestMethod]
public void FromAndToInReverseOrder()
{
const int value = 10;
var result = value.IsBetween(11, 8);
Assert.IsTrue(result);
}
[TestMethod]
public void OutsideValues()
{
const int value = 10;
var result = value.IsBetween(11, 12);
Assert.IsFalse(result);
}
[TestMethod]
public void NegativeValues()
{
const int value = -10;
var result = value.IsBetween(-9, -12);
Assert.IsTrue(result);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.