Example #1
0
        public void TestParseFileSize()
        {
            ScriptParser sp  = new ScriptParser();
            long         tmp = 25L * 1024 * 1024 * 1024;

            Assert.AreEqual(25, sp.ParseFileSize("25B"));
            Assert.AreEqual(25 * 1024 * 1024, sp.ParseFileSize("25MB"));
            Assert.AreEqual(tmp, sp.ParseFileSize("25GB"));

            Assert.Throws <ScriptParserException>(() => sp.ParseFileSize("25"));
            Assert.Throws <ScriptParserException>(() => sp.ParseFileSize("aaB"));
        }