// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
//
//
// Runs unit tests on the extension methods
//
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.UnitTests.Extensions
{
using Common.Extensions;
using NUnit.Framework;
///
/// Test harness for the DoubleExtensions extension methods
///
[TestFixture]
public class DoubleExtensionsUnitTests
{
///
/// Tests the double to byte conversion
///
/// Double input
/// Expected result
[Test]
[TestCase(-10, 0)]
[TestCase(1.5, 2)]
[TestCase(25.7, 26)]
[TestCase(1289047, 255)]
public void TestDoubleToByte(double input, byte expected)
{
byte result = input.ToByte();
Assert.AreEqual(expected, result);
}
}
}