示例#1
0
        public void CreateSublocation_Rooted()
        {
            var newFolder = TestHelper.NewAbsoluteDirectoryName();

            DirectoryInfoProxy actual = null;
            var sut = new DirectoryInfoProxy(_folder);

            Assert.Throws<ArgumentException>(() => actual = sut.CreateSublocation(newFolder));
            Assert.IsNull(actual);

            var di = new DirectoryInfo(newFolder);
            Assert.IsFalse(di.Exists);
        }
示例#2
0
        public void CreateSublocation_Relative()
        {
            // Using Resharper, folders will be build in
            // %LocalAppData%\JetBrains\Installations\ReSharperPlatformVs12
            // var basePath = @"%LocalAppData%\JetBrains\Installations\ReSharperPlatformVs12";

            var newFolder = TestHelper.NewRelativeDirectoryName();
            var sut = new DirectoryInfoProxy(_folder);

            DirectoryInfoProxy actual = null;
            Assert.DoesNotThrow(() => actual = sut.CreateSublocation(newFolder));
            Assert.IsNotNull(actual);
            Assert.IsTrue(actual.Exists);

            DirectoryInfo di = null;
            Assert.DoesNotThrow(() => di = new DirectoryInfo(actual.FullName));
            Assert.IsNotNull(di);
            Assert.IsTrue(di.Exists);

            di.Delete();
        }