mirror of https://github.com/SixLabors/ImageSharp
2 changed files with 39 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||
// --------------------------------------------------------------------------------------------------------------------
|
|||
// <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); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue