Exemple #1
0
		static void CheckAuto (GridLength gl)
		{
			Assert.AreEqual (1.0d, gl.Value, "Value");
			Assert.AreEqual (GridUnitType.Auto, gl.GridUnitType, "GridUnitType");
			Assert.IsFalse (gl.IsAbsolute, "IsAbsolute");
			Assert.IsTrue (gl.IsAuto, "IsAuto");
			Assert.IsFalse (gl.IsStar, "IsStar");
			Assert.AreEqual ("Auto", gl.ToString (), "ToString");

			Assert.IsFalse (gl.Equals (null), "Equals(null)");
			Assert.IsTrue (gl.Equals (gl), "Equals(self)");
		}
Exemple #2
0
		public void CtorDouble_Zero ()
		{
			GridLength gl = new GridLength (0);
			Assert.AreEqual (0.0d, gl.Value, "Value");
			Assert.AreEqual (GridUnitType.Pixel, gl.GridUnitType, "GridUnitType");
			Assert.IsTrue (gl.IsAbsolute, "IsAbsolute");
			Assert.IsFalse (gl.IsAuto, "IsAuto");
			Assert.IsFalse (gl.IsStar, "IsStar");
			Assert.AreEqual ("0", gl.ToString (), "ToString");
		}
Exemple #3
0
		public void CtorDoubleGridUnitType ()
		{
			GridLength gl = new GridLength (42d, GridUnitType.Star);
			Assert.AreEqual (42d, gl.Value, "Value");
			Assert.AreEqual (GridUnitType.Star, gl.GridUnitType, "GridUnitType");
			Assert.IsFalse (gl.IsAbsolute, "IsAbsolute");
			Assert.IsFalse (gl.IsAuto, "IsAuto");
			Assert.IsTrue (gl.IsStar, "IsStar");
			Assert.AreEqual ("42*", gl.ToString (), "ToString");
		}
Exemple #4
0
		public void CtorDouble_Max ()
		{
			GridLength gl = new GridLength (Double.MaxValue);
			Assert.AreEqual (Double.MaxValue, gl.Value, "Value");
			Assert.AreEqual (GridUnitType.Pixel, gl.GridUnitType, "GridUnitType");
			Assert.IsTrue (gl.IsAbsolute, "IsAbsolute");
			Assert.IsFalse (gl.IsAuto, "IsAuto");
			Assert.IsFalse (gl.IsStar, "IsStar");
			// This fails on macos
			Assert.AreEqual (Double.MaxValue.ToString (), gl.ToString (), "ToString");
		}