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.
42 lines
1.1 KiB
42 lines
1.1 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using System.Numerics;
|
|
using SixLabors.ImageSharp.ColorProfiles;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
|
|
|
|
/// <summary>
|
|
/// Tests the <see cref="CieLch"/> struct.
|
|
/// </summary>
|
|
public class CieLchTests
|
|
{
|
|
[Fact]
|
|
public void CieLchConstructorAssignsFields()
|
|
{
|
|
const float l = 75F;
|
|
const float c = 64F;
|
|
const float h = 287F;
|
|
CieLch cieLch = new(l, c, h);
|
|
|
|
Assert.Equal(l, cieLch.L);
|
|
Assert.Equal(c, cieLch.C);
|
|
Assert.Equal(h, cieLch.H);
|
|
}
|
|
|
|
[Fact]
|
|
public void CieLchEquality()
|
|
{
|
|
CieLch x = default;
|
|
CieLch y = new(Vector3.One);
|
|
|
|
Assert.True(default == default(CieLch));
|
|
Assert.False(default != default(CieLch));
|
|
Assert.Equal(default, default(CieLch));
|
|
Assert.Equal(new CieLch(1, 0, 1), new CieLch(1, 0, 1));
|
|
Assert.Equal(new CieLch(Vector3.One), new CieLch(Vector3.One));
|
|
Assert.False(x.Equals(y));
|
|
Assert.False(x.Equals((object)y));
|
|
Assert.False(x.GetHashCode().Equals(y.GetHashCode()));
|
|
}
|
|
}
|
|
|