예제 #1
0
        public void CopyFrom_Empty()
        {
            StyleTestClass s = new StyleTestClass();

            s.CopyFrom(new Style());
            Assert.IsTrue(s.Empty, "Empty");
        }
예제 #2
0
        public void CopyFrom_IsEmpty()
        {
            StyleTestClass c = new StyleTestClass();
            Style          s = GetStyle();

            s.BorderColor = Color.Azure;
            s.BorderWidth = Unit.Empty;

            c.CopyFrom(s);

            Assert.IsFalse(c.Empty, "IsEmpty");
        }
예제 #3
0
        public void Style_State()
        {
            string[] keyvalues;
            string[] expect1 =
            {
                "BorderStyle=None",
                "Font_Bold=True",
                "Font_Italic=True",
                "Height=2px",
                "CssClass=Boing",
                "BorderWidth=1px",
                "ForeColor=Color [Blue]",
                "Font_Size=1pt",
                "Font_Overline=True",
                "Width=3px",
                "BorderColor=Color [Green]",
                "Font_Names=namelist1, namelist2",
                "Font_Underline=True",
                "BackColor=Color [Red]",
                "Font_Strikeout=True"
            };
            string[] expect2 =
            {
                "BorderStyle=None",
                "Font_Bold=True",
                "Font_Italic=True",
                "Height=2px",
                "CssClass=Boing",
                "BorderWidth=1px",
                "ForeColor=Color [Blue]",
                "Font_Size=1pt",
                "Font_Overline=True",
                "Width=3px",
                "BorderColor=Color [Green]",
                "Font_Underline=True",
                "BackColor=Color [Red]",
                "Font_Strikeout=True"
            };
            string[] expect3 =
            {
                "BorderStyle=None",
                "Font_Bold=True",
                "Font_Italic=True",
                "Height=2px",
                "CssClass=Boing",
                "BorderWidth=1px",
                "ForeColor=Color [Blue]",
                "Font_Size=1pt",
                "Font_Overline=True",
                "Width=3px",
                "BorderColor=Color [Green]",
                "Font_Names=",
                "Font_Underline=True",
                "BackColor=Color [Red]",
                "Font_Strikeout=True"
            };
            StyleTestClass s;
            StyleTestClass copy;

            s = new StyleTestClass();
            SetAllValues(s);
            keyvalues = s.KeyValuePairs();

            Assert.AreEqual(15, keyvalues.Length, "State1");
            IsEqual(keyvalues, expect1, "State2");

            s.Font.Name = string.Empty;
            keyvalues   = s.KeyValuePairs();
            Assert.AreEqual(expect2.Length, keyvalues.Length, "State3");
            IsEqual(keyvalues, expect2, "State4");

            s.Font.Names = null;
            keyvalues    = s.KeyValuePairs();
            Assert.AreEqual(expect2.Length, keyvalues.Length, "State5");
            IsEqual(keyvalues, expect2, "State6");

            copy = new StyleTestClass();
            copy.CopyFrom(s);
            keyvalues = copy.KeyValuePairs();
            Assert.AreEqual(expect3.Length, keyvalues.Length, "State7");
            IsEqual(keyvalues, expect3, "State8");

            Assert.AreEqual(false, copy.IsTracking, "State9");
        }
예제 #4
0
파일: StyleTest.cs 프로젝트: nobled/mono
		public void CopyFrom_IsEmpty ()
		{
			StyleTestClass c = new StyleTestClass ();
			Style s = GetStyle ();

			s.BorderColor = Color.Azure;
			s.BorderWidth = Unit.Empty;

			c.CopyFrom (s);

			Assert.IsFalse (c.Empty, "IsEmpty");
		}
예제 #5
0
파일: StyleTest.cs 프로젝트: nobled/mono
		public void CopyFrom_Empty ()
		{
			StyleTestClass s = new StyleTestClass ();
			s.CopyFrom (new Style ());
			Assert.IsTrue (s.Empty, "Empty");
		}
예제 #6
0
파일: StyleTest.cs 프로젝트: nobled/mono
		public void Style_State () {
			string[]	keyvalues;
			string[]	expect1 = {
						"BorderStyle=None",
						"Font_Bold=True",
						"Font_Italic=True",
						"Height=2px",
						"CssClass=Boing",
						"BorderWidth=1px",
						"ForeColor=Color [Blue]",
						"Font_Size=1pt",
						"Font_Overline=True",
						"Width=3px",
						"BorderColor=Color [Green]",
						"Font_Names=namelist1, namelist2",
						"Font_Underline=True",
						"BackColor=Color [Red]",
						"Font_Strikeout=True" };
			string[]	expect2 = {
						"BorderStyle=None",
						"Font_Bold=True",
						"Font_Italic=True",
						"Height=2px",
						"CssClass=Boing",
						"BorderWidth=1px",
						"ForeColor=Color [Blue]",
						"Font_Size=1pt",
						"Font_Overline=True",
						"Width=3px",
						"BorderColor=Color [Green]",
						"Font_Underline=True",
						"BackColor=Color [Red]",
						"Font_Strikeout=True" };
			string[]	expect3 = {
						"BorderStyle=None",
						"Font_Bold=True",
						"Font_Italic=True",
						"Height=2px",
						"CssClass=Boing",
						"BorderWidth=1px",
						"ForeColor=Color [Blue]",
						"Font_Size=1pt",
						"Font_Overline=True",
						"Width=3px",
						"BorderColor=Color [Green]",
						"Font_Names=",
						"Font_Underline=True",
						"BackColor=Color [Red]",
						"Font_Strikeout=True" };
			StyleTestClass	s;
			StyleTestClass	copy;

			s = new StyleTestClass();
			SetAllValues(s);
			keyvalues = s.KeyValuePairs();
			
			Assert.AreEqual (15, keyvalues.Length, "State1");
			IsEqual(keyvalues, expect1, "State2");

			s.Font.Name = string.Empty;
			keyvalues = s.KeyValuePairs();
			Assert.AreEqual (expect2.Length, keyvalues.Length, "State3");
			IsEqual(keyvalues, expect2, "State4");

			s.Font.Names = null;
			keyvalues = s.KeyValuePairs();
			Assert.AreEqual (expect2.Length, keyvalues.Length, "State5");
			IsEqual(keyvalues, expect2, "State6");

			copy = new StyleTestClass();
			copy.CopyFrom(s);
			keyvalues = copy.KeyValuePairs();
			Assert.AreEqual (expect3.Length, keyvalues.Length, "State7");
			IsEqual(keyvalues, expect3, "State8");

			Assert.AreEqual (false, copy.IsTracking, "State9");

		}