示例#1
0
        public void CheckIfHashCanBeRedFromAFileWithoutExtension()
        {
            var isValid = true;
            var file    = File.Create("test");

            file.Close();
            try
            {
                FileInformation.GetHash("test");
            }
            catch
            {
                isValid = false;
            }
            File.Delete("test");
            Assert.IsTrue(isValid, "Can't read information from a file without extension");
            File.Delete("test");
        }
示例#2
0
        public void CheckIfHashCanBeRedFromAFileWithoutExtensionInADirectory()
        {
            var isValid       = true;
            var fileName      = "test";
            var directoryName = "test";

            fileName = directoryName + "\\" + fileName;
            Directory.CreateDirectory(directoryName);
            var file = File.Create(fileName);

            file.Close();
            try
            {
                FileInformation.GetHash(fileName);
            }
            catch
            {
                isValid = false;
            }
            Directory.Delete("test", true);
            Assert.IsTrue(isValid, "Can't read information from a file without extension, in a directory");
        }