Ejemplo n.º 1
0
 public void IsValid_Data_IsTrue()
 {
     using (CultureInfoScope.NewInvariant())
     {
         Assert.IsTrue(StreamSize.IsValid("19 MB"));
         Assert.IsTrue(StreamSize.IsValid("1,456.134 MB"));
     }
 }
Ejemplo n.º 2
0
        public void IsValid_Data_IsFalse()
        {
            using (CultureInfoScope.NewInvariant())
            {
                Assert.IsFalse(StreamSize.IsValid("Complex"), "Complex");
                Assert.IsFalse(StreamSize.IsValid((String)null), "(String)null");
                Assert.IsFalse(StreamSize.IsValid(string.Empty), "string.Empty");

                Assert.IsFalse(StreamSize.IsValid("1234 EB"), "1234 EB, to big");
                Assert.IsFalse(StreamSize.IsValid("-1234EB"), "-1234EB, to small");

                Assert.IsFalse(StreamSize.IsValid("12.9 EB"), "12.9 EB, to big");
                Assert.IsFalse(StreamSize.IsValid("-12.9EB"), "-12.9EB, to small");

                Assert.IsFalse(StreamSize.IsValid("79,228,162,514,264,337,593,543,950,335 kB"), "12.9 EB, to big for decimal");
                Assert.IsFalse(StreamSize.IsValid("-9,228,162,514,264,337,593,543,950,335 kB"), "-12.9EB, to small for decimal");
            }
        }