Ejemplo n.º 1
0
        public void ConvertDirectory_WithInvalidDirname_ThrowsFormatException()
        {
            var input     = "fol||der";
            var converter = new DirectoryInfoConverter();

            Assert.ThrowsException <FormatException>(
                () => converter.ConvertFromInvariantString(input));
        }
Ejemplo n.º 2
0
        public void ConvertDirectory_WithExistingDirname_DirectoryInfoExistsIsTrue()
        {
            var input     = "folder";
            var converter = new DirectoryInfoConverter();

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

            Assert.IsTrue(actual.Exists);
        }
Ejemplo n.º 3
0
        public void ConvertDirectory_WithExistingDirname_ReturnsDirectoryInfoObject()
        {
            var expected = new DirectoryInfo("folder").FullName;

            var input     = "folder";
            var converter = new DirectoryInfoConverter();

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

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