コード例 #1
0
        public void FileNameNullorEmpty_ThrowsException()
        {
            Service.FileProcess fp = new TryItOut.Service.FileProcess();

            // Throws exception as Empty filename
            fp.FileExists("");
        }
コード例 #2
0
        public void FileNameNullorEmpty_ThrowsException_TryCatch()
        {
            Service.FileProcess fp = new TryItOut.Service.FileProcess();

            try
            {
                // Throws exception as Empty filename
                fp.FileExists("");
            }
            catch (ArgumentNullException)
            {
                // Success as trapped exception
                return;
            }

            Assert.Fail("Arguement Exception not thrown.");
        }