Example #1
0
        public void TyrParse_Null_IsInvalid()
        {
            StreamSize val;
            string     str = null;

            Assert.IsFalse(StreamSize.TryParse(str, out val));
        }
Example #2
0
        public void TyrParse_StringEmpty_IsInvalid()
        {
            StreamSize val;
            string     str = string.Empty;

            Assert.IsFalse(StreamSize.TryParse(str, out val));
        }
Example #3
0
        public void TyrParse_StringValue_IsValid()
        {
            string str = "17kb";

            Assert.IsTrue(StreamSize.TryParse(str, out StreamSize val), "Valid");
            Assert.AreEqual("17000 byte", val.ToString(), "Value");
        }
Example #4
0
        public void TryParse_InvalidInput_DefaultValue()
        {
            using (new CultureInfoScope("en-GB"))
            {
                var exp = default(StreamSize);
                var act = StreamSize.TryParse("InvalidInput");

                Assert.AreEqual(exp, act);
            }
        }
Example #5
0
        public void TryParse_TestStructInput_AreEqual()
        {
            using (new CultureInfoScope("en-GB"))
            {
                var exp = TestStruct;
                var act = StreamSize.TryParse(exp.ToString());

                Assert.AreEqual(exp, act);
            }
        }