-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: OutlinedTextBlock throwing when too small
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Windows; | ||
using Hearthstone_Deck_Tracker; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace HDTTests | ||
{ | ||
[TestClass] | ||
public class OutlinedTextBlockTests | ||
{ | ||
[TestMethod] | ||
public void MeasureOverride_BadSize_DoesNotThrow() | ||
{ | ||
var textBlock = new TestTextBlock | ||
{ | ||
TextWrapping = TextWrapping.NoWrap, | ||
Text = "Test", | ||
FontSize = 0.1 | ||
}; | ||
try | ||
{ | ||
textBlock.CallMeasureOverride(new Size(0, 0)); | ||
} | ||
catch(Exception e) | ||
{ | ||
Assert.Fail(e.Message); | ||
} | ||
} | ||
|
||
private class TestTextBlock : OutlinedTextBlock | ||
{ | ||
public void CallMeasureOverride(Size availableSize) | ||
{ | ||
MeasureOverride(availableSize); | ||
} | ||
} | ||
} | ||
} |
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