Skip to content

Commit

Permalink
modify label tests to use new font module features
Browse files Browse the repository at this point in the history
  • Loading branch information
swharden committed Jan 29, 2020
1 parent ab1ddd0 commit c16d4c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions tests/Plot/Title.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ public void Test_FontName_IsSettable()
{
ScottPlot.Plot plt = TestTools.SamplePlotScatter();

string font1 = System.Drawing.FontFamily.GenericSerif.Name;
string font1 = ScottPlot.Config.Fonts.GetSerifFontName();
string font2 = ScottPlot.Config.Fonts.GetMonospaceFontName();
Assert.That(font1 != font2);

plt.Title(sampleLabel, fontName: font1);
string hash1 = TestTools.HashedFig(plt, font1);

string font2 = System.Drawing.FontFamily.GenericSansSerif.Name;
plt.Title(sampleLabel, fontName: font2);
string hash2 = TestTools.HashedFig(plt, font2);

Expand Down
6 changes: 4 additions & 2 deletions tests/Plot/XLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ public void Test_FontName_IsSettable()
{
ScottPlot.Plot plt = TestTools.SamplePlotScatter();

string font1 = System.Drawing.FontFamily.GenericSerif.Name;
string font1 = ScottPlot.Config.Fonts.GetSerifFontName();
string font2 = ScottPlot.Config.Fonts.GetMonospaceFontName();
Assert.That(font1 != font2);

plt.XLabel(sampleLabel, fontName: font1);
string hash1 = TestTools.HashedFig(plt, font1);

string font2 = System.Drawing.FontFamily.GenericSansSerif.Name;
plt.XLabel(sampleLabel, fontName: font2);
string hash2 = TestTools.HashedFig(plt, font2);

Expand Down
6 changes: 4 additions & 2 deletions tests/Plot/YLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ public void Test_FontName_IsSettable()
{
ScottPlot.Plot plt = TestTools.SamplePlotScatter();

string font1 = System.Drawing.FontFamily.GenericSerif.Name;
string font1 = ScottPlot.Config.Fonts.GetSerifFontName();
string font2 = ScottPlot.Config.Fonts.GetMonospaceFontName();
Assert.That(font1 != font2);

plt.YLabel(sampleLabel, fontName: font1);
string hash1 = TestTools.HashedFig(plt, font1);

string font2 = System.Drawing.FontFamily.GenericSansSerif.Name;
plt.YLabel(sampleLabel, fontName: font2);
string hash2 = TestTools.HashedFig(plt, font2);

Expand Down

0 comments on commit c16d4c9

Please sign in to comment.