public void TestConvertFrom()
 {
     FontConverter.FontNameConverter f = new FontConverter.FontNameConverter();
     // returns "Times" under Linux and "Times New Roman" under Windows
     Assert.IsTrue((f.ConvertFrom("Times") as string).StartsWith("Times"), "string test");
     Assert.IsTrue(f.GetStandardValuesSupported(), "standard values supported");
     Assert.IsFalse(f.GetStandardValuesExclusive(), "standard values exclusive");
 }
Пример #2
0
 public void TestConvertFrom()
 {
     FontConverter.FontNameConverter converter = new FontConverter.FontNameConverter();
     // returns "Times" under Linux and "Times New Roman" under Windows
     if (PlatformDetection.IsWindows)
     {
         Assert.Equal("Times New Roman", converter.ConvertFrom("Times") as string);
     }
     else
     {
         Assert.Equal("Times", converter.ConvertFrom("Times") as string);
     }
     Assert.True(converter.GetStandardValuesSupported(), "standard values supported");
     Assert.False(converter.GetStandardValuesExclusive(), "standard values exclusive");
 }
Пример #3
0
 public void ExTestConvertFrom_ThrowsNotSupportedException()
 {
     FontConverter.FontNameConverter converter = new FontConverter.FontNameConverter();
     Assert.Throws <NotSupportedException>(() => converter.ConvertFrom(null));
     Assert.Throws <NotSupportedException>(() => converter.ConvertFrom(1));
 }
 public void ExTestConvertFrom2()
 {
     FontConverter.FontNameConverter f = new FontConverter.FontNameConverter();
     Assert.Throws <NotSupportedException> (() => f.ConvertFrom(1));
 }
 public void ExTestConvertFrom2()
 {
     FontConverter.FontNameConverter f = new FontConverter.FontNameConverter();
     f.ConvertFrom(1);
 }