-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced System.Drawing.Color by custom DotColor
- Loading branch information
Showing
16 changed files
with
257 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using System.Drawing; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using DotNetGraph.Attributes; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using DotNetGraph.Core; | ||
using FluentAssertions; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace DotNetGraph.Tests.Core; | ||
|
||
[TestClass] | ||
public class DotColorTests | ||
{ | ||
[DataTestMethod] | ||
[DataRow(255, 0, 0, 255, 0, 0, 255, 255, false)] | ||
[DataRow(128, 15, 255, 255, 128, 15, 255, 255, true)] | ||
public void EqualsWithAnother(int r1, int g1, int b1, int a1, int r2, int g2, int b2, int a2, bool expectedEqual) | ||
{ | ||
var color1 = new DotColor((byte) r1, (byte) g1, (byte) b1, (byte) a1); | ||
var color2 = new DotColor((byte) r2, (byte) g2, (byte) b2, (byte) a2); | ||
|
||
var equal = color1.Equals(color2); | ||
|
||
equal.Should().Be(expectedEqual); | ||
} | ||
|
||
[TestMethod] | ||
public void ToHexStringRgb() | ||
{ | ||
var color = new DotColor(123, 123, 255); | ||
|
||
var hex = color.ToHexString(); | ||
|
||
hex.Should().Be("#7B7BFF"); | ||
} | ||
|
||
[TestMethod] | ||
public void ToHexStringRgba() | ||
{ | ||
var color = new DotColor(123, 123, 255, 123); | ||
|
||
var hex = color.ToHexString(); | ||
|
||
hex.Should().Be("#7B7BFF7B"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
Sources/DotNetGraph.Tests/Extensions/ColorExtensionsTests.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.