public void ParseObject()
        {
            object value  = "{Width=1,Height=2}";
            var    actual = SizeExtensions.Parse(value);

            Assert.AreEqual(new Size(1, 2), actual);
        }
        public void ParseWithSpaceAfterComma()
        {
            var actual = SizeExtensions.Parse("{Width=1, Height=2}");

            Assert.AreEqual(new Size(1, 2), actual);
        }
 public void ParseOneNegativeOnePositive()
 {
     Assert.AreEqual(new Size(1, -2), SizeExtensions.Parse("{Width=1,Height=-2}"));
     Assert.AreEqual(new Size(-1, 2), SizeExtensions.Parse("{Width=-1,Height=2}"));
 }
        public void ParseNegatives()
        {
            var actual = SizeExtensions.Parse("{Width=-1,Height=-2}");

            Assert.AreEqual(new Size(-1, -2), actual);
        }
        public void ParseManyDigits()
        {
            var actual = SizeExtensions.Parse("{Width=12345,Height=67890}");

            Assert.AreEqual(new Size(12345, 67890), actual);
        }
        public void ParsePositives()
        {
            var actual = SizeExtensions.Parse("{Width=1,Height=2}");

            Assert.AreEqual(new Size(1, 2), actual);
        }
        public void ParseZeroes()
        {
            var actual = SizeExtensions.Parse("{Width=0,Height=0}");

            Assert.AreEqual(Size.Empty, actual);
        }
        public void ParseEmptyString()
        {
            var actual = SizeExtensions.Parse(String.Empty);

            Assert.AreEqual(Size.Empty, actual);
        }
        public void ParseNull()
        {
            var actual = SizeExtensions.Parse(null);

            Assert.AreEqual(Size.Empty, actual);
        }
Example #10
0
 public override string ToString()
 {
     return($"{Cpu}/{SizeExtensions.SizeSuffix((long)Ram, 2)}");
 }