Ejemplo n.º 1
0
        public void GetChecksum_Path_DoesNotExist()
        {
            string buildFragment =
                "<project>" +
                "   <property name=\"checksum\" value=\"${file::get-checksum('doesnotexist','MD5')}\" />" +
                "</project>";

            try {
                RunBuild(buildFragment);
                Assert.Fail("#1");
            } catch (TestBuildException ex) {
                Assert.IsNotNull(ex.InnerException, "#2");
                BuildException be = ex.InnerException as BuildException;
                Assert.IsNotNull(be, "#3");
                Assert.AreEqual(typeof(BuildException), be.GetType(), "#4");
                Assert.IsNotNull(be.InnerException, "#5");
                Assert.AreEqual(typeof(FileNotFoundException), be.InnerException.GetType(), "#6");
            }
        }
Ejemplo n.º 2
0
        public void GetChecksum_Algorithm_DoesNotExist()
        {
            string buildFragment =
                "<project>" +
                "   <echo file=\"checksum.input\">test input file</echo>" +
                "   <property name=\"checksum\" value=\"${file::get-checksum('checksum.input','ZZZ')}\" />" +
                "</project>";

            try {
                RunBuild(buildFragment);
                Assert.Fail("#1");
            } catch (TestBuildException ex) {
                Assert.IsNotNull(ex.InnerException, "#2");
                BuildException be = ex.InnerException as BuildException;
                Assert.IsNotNull(be, "#3");
                Assert.AreEqual(typeof(BuildException), be.GetType(), "#4");
                Assert.IsNotNull(be.InnerException, "#5");
                Assert.AreEqual(typeof(ArgumentException), be.InnerException.GetType(), "#6");
            }
        }