示例#1
0
        public void ToLogFont_AssertUnmanagedCode()
        {
            Font    f  = new Font("Arial", 10);
            LOGFONT lf = new LOGFONT();

            f.ToLogFont(lf);
            Assert.AreEqual(400, lf.lfWeight, "lfWeight");
            Assert.AreEqual(1, lf.lfCharSet, "lfCharSet");
            Assert.AreEqual(f.Name, lf.lfFaceName, "lfFaceName");

            LOGFONT_STRUCT lfs = new LOGFONT_STRUCT();

            f.ToLogFont(lfs);
            Assert.AreEqual(0, lfs.lfWeight, "struct-lfWeight");
            Assert.AreEqual(0, lfs.lfCharSet, "struct-lfCharSet");
            Assert.AreEqual(0, lfs.lfHeight, "struct-lfHeight");
            Assert.AreEqual(0, lfs.lfWidth, "struct-lfWidth");
            Assert.AreEqual(0, lfs.lfEscapement, "struct-lfEscapement");
            Assert.AreEqual(0, lfs.lfOrientation, "struct-lfOrientation");
            Assert.AreEqual(0, lfs.lfWeight, "struct-lfWeight");
            Assert.AreEqual(0, lfs.lfItalic, "struct-lfItalic");
            Assert.AreEqual(0, lfs.lfUnderline, "struct-lfUnderline");
            Assert.AreEqual(0, lfs.lfStrikeOut, "struct-lfStrikeOut");
            Assert.AreEqual(0, lfs.lfCharSet, "struct-lfCharSet");
            Assert.AreEqual(0, lfs.lfOutPrecision, "struct-lfOutPrecision");
            Assert.AreEqual(0, lfs.lfClipPrecision, "struct-lfClipPrecision");
            Assert.AreEqual(0, lfs.lfQuality, "struct-lfQuality");
            Assert.AreEqual(0, lfs.lfPitchAndFamily, "struct-lfPitchAndFamily");
            Assert.IsNull(lfs.lfFaceName, "struct-lfFaceName");
        }
示例#2
0
		public void ToLogFont_AssertUnmanagedCode ()
		{
			Font f = new Font("Arial", 10);
			LOGFONT	lf = new LOGFONT();

			f.ToLogFont (lf);
			Assert.AreEqual (400, lf.lfWeight, "lfWeight");
			Assert.AreEqual (1, lf.lfCharSet, "lfCharSet");
			Assert.AreEqual (f.Name, lf.lfFaceName, "lfFaceName");

			LOGFONT_STRUCT lfs = new LOGFONT_STRUCT ();
			f.ToLogFont (lfs);
			Assert.AreEqual (0, lfs.lfWeight, "struct-lfWeight");
			Assert.AreEqual (0, lfs.lfCharSet, "struct-lfCharSet");
			Assert.AreEqual (0, lfs.lfHeight, "struct-lfHeight");
			Assert.AreEqual (0, lfs.lfWidth, "struct-lfWidth");
			Assert.AreEqual (0, lfs.lfEscapement, "struct-lfEscapement");
			Assert.AreEqual (0, lfs.lfOrientation, "struct-lfOrientation");
			Assert.AreEqual (0, lfs.lfWeight, "struct-lfWeight");
			Assert.AreEqual (0, lfs.lfItalic, "struct-lfItalic");
			Assert.AreEqual (0, lfs.lfUnderline, "struct-lfUnderline");
			Assert.AreEqual (0, lfs.lfStrikeOut, "struct-lfStrikeOut");
			Assert.AreEqual (0, lfs.lfCharSet, "struct-lfCharSet");
			Assert.AreEqual (0, lfs.lfOutPrecision, "struct-lfOutPrecision");
			Assert.AreEqual (0, lfs.lfClipPrecision, "struct-lfClipPrecision");
			Assert.AreEqual (0, lfs.lfQuality, "struct-lfQuality");
			Assert.AreEqual (0, lfs.lfPitchAndFamily, "struct-lfPitchAndFamily");
			Assert.IsNull (lfs.lfFaceName, "struct-lfFaceName");
		}