-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f60ed86
commit d19a320
Showing
9 changed files
with
87 additions
and
6 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
19 changes: 19 additions & 0 deletions
19
tests/BB84.ExtensionsTests/ColorExtensionsTests.FromArgbByteArray.cs
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,19 @@ | ||
using System.Drawing; | ||
|
||
using BB84.Extensions; | ||
|
||
namespace BB84.ExtensionsTests; | ||
|
||
public sealed partial class ColorExtensionsTests | ||
{ | ||
[DataTestMethod] | ||
[DynamicData(nameof(GetArgbByteData), DynamicDataSourceType.Method)] | ||
public void FromArgbByteArrayTest(Color expected, byte[] value) | ||
=> Assert.AreEqual(expected.ToArgb(), value.FromArgbByteArray().ToArgb()); | ||
|
||
[TestMethod] | ||
[ExpectedException(typeof(ArgumentException))] | ||
public void FromArgbByteArrayExceptionTest() | ||
=> Array.Empty<byte>().FromArgbByteArray(); | ||
|
||
} |
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
18 changes: 18 additions & 0 deletions
18
tests/BB84.ExtensionsTests/ColorExtensionsTests.FromRgbByteArray.cs
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,18 @@ | ||
using System.Drawing; | ||
|
||
using BB84.Extensions; | ||
|
||
namespace BB84.ExtensionsTests; | ||
|
||
public sealed partial class ColorExtensionsTests | ||
{ | ||
[DataTestMethod] | ||
[DynamicData(nameof(GetRgbByteData), DynamicDataSourceType.Method)] | ||
public void FromRgbByteArrayTest(Color expected, byte[] value) | ||
=> Assert.AreEqual(expected.ToArgb(), value.FromRgbByteArray().ToArgb()); | ||
|
||
[TestMethod] | ||
[ExpectedException(typeof(ArgumentException))] | ||
public void FromRgbByteArrayExceptionTest() | ||
=> Array.Empty<byte>().FromRgbByteArray(); | ||
} |
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
13 changes: 13 additions & 0 deletions
13
tests/BB84.ExtensionsTests/ColorExtensionsTests.ToArgbByteArray.cs
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,13 @@ | ||
using System.Drawing; | ||
|
||
using BB84.Extensions; | ||
|
||
namespace BB84.ExtensionsTests; | ||
|
||
public sealed partial class ColorExtensionsTests | ||
{ | ||
[DataTestMethod] | ||
[DynamicData(nameof(GetArgbByteData), DynamicDataSourceType.Method)] | ||
public void ToArgbByteArrayTest(Color value, byte[] excpected) | ||
=> Assert.IsTrue(excpected.SequenceEqual(value.ToArgbByteArray())); | ||
} |
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
13 changes: 13 additions & 0 deletions
13
tests/BB84.ExtensionsTests/ColorExtensionsTests.ToRgbByteArray.cs
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,13 @@ | ||
using System.Drawing; | ||
|
||
using BB84.Extensions; | ||
|
||
namespace BB84.ExtensionsTests; | ||
|
||
public sealed partial class ColorExtensionsTests | ||
{ | ||
[DataTestMethod] | ||
[DynamicData(nameof(GetRgbByteData), DynamicDataSourceType.Method)] | ||
public void ToRgbByteArrayTest(Color value, byte[] expected) | ||
=> Assert.IsTrue(expected.SequenceEqual(value.ToRgbByteArray())); | ||
} |
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