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.
39 lines
957 B
39 lines
957 B
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using SixLabors.ImageSharp.Common.Helpers;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Helpers;
|
|
|
|
public class UnitConverterHelperTests
|
|
{
|
|
[Fact]
|
|
public void InchToFromMeter()
|
|
{
|
|
const double expected = 96D;
|
|
double actual = UnitConverter.InchToMeter(expected);
|
|
actual = UnitConverter.MeterToInch(actual);
|
|
|
|
Assert.Equal(expected, actual, 15);
|
|
}
|
|
|
|
[Fact]
|
|
public void InchToFromCm()
|
|
{
|
|
const double expected = 96D;
|
|
double actual = UnitConverter.InchToCm(expected);
|
|
actual = UnitConverter.CmToInch(actual);
|
|
|
|
Assert.Equal(expected, actual, 15);
|
|
}
|
|
|
|
[Fact]
|
|
public void CmToFromMeter()
|
|
{
|
|
const double expected = 96D;
|
|
double actual = UnitConverter.CmToMeter(expected);
|
|
actual = UnitConverter.MeterToCm(actual);
|
|
|
|
Assert.Equal(expected, actual, 15);
|
|
}
|
|
}
|
|
|