Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/11 12:37:16 (14 years ago)
Author:
epitzer
Message:

Small improvements to font serialization: (#1487)

  • included font size units and vertical font indicator for complete serialization
  • removed unnecessary checks for null during serialization
  • removed checks during deserializaiton: incorrect files should not cause nulls to be deserialized but throw an error instead
  • added unit test
  • replaced string concatenation with string.Format()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram/HeuristicLab.Persistence/3.3/Tests/UseCases.cs

    r5698 r6027  
    12551255    }
    12561256
     1257    [TestMethod]
     1258    public void FontTest() {
     1259      List<Font> fonts = new List<Font>() {
     1260        new Font(FontFamily.Families.First(), 12),
     1261        new Font("Times New Roman", 21, FontStyle.Bold, GraphicsUnit.Pixel),
     1262        new Font("Courier New", 10, FontStyle.Underline, GraphicsUnit.Document),
     1263        new Font("Helvetica", 21, FontStyle.Strikeout, GraphicsUnit.Inch, 0, true),
     1264      };
     1265      XmlGenerator.Serialize(fonts, tempFile);
     1266      var newFonts = XmlParser.Deserialize<List<Font>>(tempFile);
     1267      Assert.AreEqual(fonts[0], newFonts[0]);
     1268      Assert.AreEqual(fonts[1], newFonts[1]);
     1269      Assert.AreEqual(fonts[2], newFonts[2]);
     1270      Assert.AreEqual(fonts[3], newFonts[3]);
     1271    }
     1272
    12571273
    12581274
Note: See TracChangeset for help on using the changeset viewer.