-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Graphics Font comparison method (#15985)
* Fix the issue * Added more tests * Updated Impl
- Loading branch information
1 parent
9ceea53
commit 7667bb8
Showing
2 changed files
with
38 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Xunit; | ||
|
||
namespace Microsoft.Maui.Graphics.Tests | ||
{ | ||
public class FontUnitTests | ||
{ | ||
[Fact] | ||
public void TestEqualsDefault() | ||
{ | ||
Assert.True(Font.Default.Equals(Font.Default)); | ||
} | ||
|
||
[Fact] | ||
public void TestEqualsDefaultBold() | ||
{ | ||
Assert.True(Font.DefaultBold.Equals(Font.DefaultBold)); | ||
} | ||
|
||
[Fact] | ||
public void TestEqualsDefaultFonts() | ||
{ | ||
Assert.False(Font.Default.Equals(Font.DefaultBold)); | ||
} | ||
|
||
[Fact] | ||
public void TestEqualsArialFont() | ||
{ | ||
var font1 = new Font("Arial"); | ||
var font2 = new Font("Arial"); | ||
Assert.True(font1.Equals(font2)); | ||
} | ||
} | ||
} |