mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
// --------------------------------------------------------------------------------------------------------------------
|
|
// <copyright file="IntegerExtensionsUnitTests.cs" company="James South">
|
|
// Copyright (c) James South.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
// </copyright>
|
|
// <summary>
|
|
// Runs unit tests on the <see cref="IntegerExtensions" /> extension methods
|
|
// </summary>
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
namespace ImageProcessor.UnitTests
|
|
{
|
|
using System;
|
|
using Common.Extensions;
|
|
using NUnit.Framework;
|
|
|
|
/// <summary>
|
|
/// Provides a test harness for the integer extension class
|
|
/// </summary>
|
|
[TestFixture]
|
|
public class IntegerExtensionsUnitTests
|
|
{
|
|
/// <summary>
|
|
/// Tests the "ToByte" extension
|
|
/// </summary>
|
|
/// <param name="input">Integer input</param>
|
|
/// <param name="expected">Expected result</param>
|
|
[Test]
|
|
[TestCase(21, 0x15)]
|
|
[TestCase(190, 0xBE)]
|
|
[TestCase(3156, 0xFF)]
|
|
public void ToByteTest(int input, byte expected)
|
|
{
|
|
var result = input.ToByte();
|
|
Assert.AreEqual(expected, result);
|
|
}
|
|
}
|
|
}
|