Esempio n. 1
0
        public void hashTest2()
        {
            var target = new FunctionComponent();

            try {
                target.parse("[Func hash.MD5]");
                Assert.Fail("1");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.SHA1]");
                Assert.Fail("2");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(IncorrectNodeException), ex.GetType().ToString()); }
        }
        public void hashTest2()
        {
            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.MD5]");
                Assert.Fail("1");
            }
            catch(OperationNotFoundException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.SHA1]");
                Assert.Fail("2");
            }
            catch(OperationNotFoundException) {
                Assert.IsTrue(true);
            }
        }
 public void hashTest3()
 {
     FunctionComponent target = new FunctionComponent();
     Assert.AreEqual("ED076287532E86365E841E92BFC50D8C", target.parse("[Func hash.MD5(\"Hello World!\")]"));
     Assert.AreEqual("2EF7BDE608CE5404E97D5F042F95F89F1C232871", target.parse("[Func hash.SHA1(\"Hello World!\")]"));
 }
 public void parseTest1()
 {
     FunctionComponent target = new FunctionComponent();
     target.parse("[Func NotRealSubtype.check]");
 }
 public void hashTest7()
 {
     FunctionComponent target = new FunctionComponent();
     Assert.AreEqual("D41D8CD98F00B204E9800998ECF8427E", target.parse("[Func hash.MD5(\"\")]"));
     Assert.AreEqual("DA39A3EE5E6B4B0D3255BFEF95601890AFD80709", target.parse("[Func hash.SHA1(\"\")]"));
 }
        public void hashTest6()
        {
            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.MD5()]");
                Assert.Fail("1");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.SHA1()]");
                Assert.Fail("2");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.MD5(test)]");
                Assert.Fail("3");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.SHA1(test)]");
                Assert.Fail("4");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.MD5(\"test\", true)]");
                Assert.Fail("5");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.SHA1(\"test\", true)]");
                Assert.Fail("6");
            }
            catch(InvalidArgumentException) {
                Assert.IsTrue(true);
            }
        }
        public void hashTest5()
        {
            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.MD5(\"Hello World!\") = true]");
                Assert.Fail("1");
            }
            catch(NotSupportedOperationException) {
                Assert.IsTrue(true);
            }

            try {
                FunctionComponent target = new FunctionComponent();
                target.parse("[Func hash.SHA1(\"Hello World!\") = true]");
                Assert.Fail("2");
            }
            catch(NotSupportedOperationException) {
                Assert.IsTrue(true);
            }
        }
Esempio n. 8
0
        public void hashTest6()
        {
            var target = new FunctionComponent();

            try {
                target.parse("[Func hash.MD5()]");
                Assert.Fail("1");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.SHA1()]");
                Assert.Fail("2");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.MD5(test)]");
                Assert.Fail("3");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.SHA1(test)]");
                Assert.Fail("4");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.MD5(\"test\", true)]");
                Assert.Fail("5");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.SHA1(\"test\", true)]");
                Assert.Fail("6");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(InvalidArgumentException), ex.GetType().ToString()); }
        }
Esempio n. 9
0
        public void hashTest5()
        {
            var target = new FunctionComponent();

            try {
                target.parse("[Func hash.MD5(\"Hello World!\") = true]");
                Assert.Fail("1");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }

            try {
                target.parse("[Func hash.SHA1(\"Hello World!\") = true]");
                Assert.Fail("2");
            }
            catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(NotSupportedOperationException), ex.GetType().ToString()); }
        }