From c16d4c92f33d3c93c44c85f8672cc11dc2c3f609 Mon Sep 17 00:00:00 2001 From: Scott W Harden Date: Tue, 28 Jan 2020 22:36:53 -0500 Subject: [PATCH] modify label tests to use new font module features relates to #222 and #212 and #216 --- tests/Plot/Title.cs | 6 ++++-- tests/Plot/XLabel.cs | 6 ++++-- tests/Plot/YLabel.cs | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/Plot/Title.cs b/tests/Plot/Title.cs index b60ce7476a..9c145813ec 100644 --- a/tests/Plot/Title.cs +++ b/tests/Plot/Title.cs @@ -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); diff --git a/tests/Plot/XLabel.cs b/tests/Plot/XLabel.cs index c55ee0af19..d8f945f9d4 100644 --- a/tests/Plot/XLabel.cs +++ b/tests/Plot/XLabel.cs @@ -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); diff --git a/tests/Plot/YLabel.cs b/tests/Plot/YLabel.cs index 8c3744e3fa..d3346e418b 100644 --- a/tests/Plot/YLabel.cs +++ b/tests/Plot/YLabel.cs @@ -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);