Exemplo n.º 1
0
        public void ConvertFile_WithInvalidFilename_ThrowsFormatException()
        {
            var input     = "folder\\fi||le.txt";
            var converter = new FileInfoConverter();

            Assert.ThrowsException <FormatException>(
                () => converter.ConvertFromInvariantString(input));
        }
Exemplo n.º 2
0
        public void ConvertFile_WithExistingFilename_FileInfoExistsIsTrue()
        {
            var input     = "folder\\sample.txt";
            var converter = new FileInfoConverter();

            var actual = (FileInfo)converter.ConvertFromInvariantString(input);

            Assert.IsTrue(actual.Exists);
        }
Exemplo n.º 3
0
        public void ConvertFile_WithExistingFilename_ReturnsFileInfoObject()
        {
            var expected = new FileInfo("folder\\sample.txt").FullName;

            var input     = "folder\\sample.txt";
            var converter = new FileInfoConverter();

            var actual = (FileInfo)converter.ConvertFromInvariantString(input);

            Assert.AreEqual(expected, actual.FullName);
        }