コード例 #1
0
        public void DirectoryExists_GivenFolderDoesNotExist_ShouldReturnTrue()
        {
            //---------------Set up test pack-------------------
            var fileSystemAdapter = new FileSystemAdapter();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var folderExists = fileSystemAdapter.DirectoryExists(Guid.NewGuid().ToString());

            //---------------Test Result -----------------------
            Assert.IsFalse(folderExists);
        }
コード例 #2
0
        public void DirectoryExists_GivenFolderExists_ShouldReturnTrue()
        {
            using (var sandboxPath = new SandboxPath())
            {
                //---------------Set up test pack-------------------
                var fileSystemAdapter = new FileSystemAdapter();
                //---------------Assert Precondition----------------

                //---------------Execute Test ----------------------
                var folderExists = fileSystemAdapter.DirectoryExists(sandboxPath.FullPath);
                //---------------Test Result -----------------------
                Assert.IsTrue(folderExists);
            }
        }
コード例 #3
0
        public void CreateDirectory_ShouldCreateDirectory()
        {
            using (var sandboxPath = new SandboxPath())
            {
                //---------------Set up test pack-------------------
                var fileSystemAdapter = new FileSystemAdapter();
                //---------------Assert Precondition----------------

                //---------------Execute Test ----------------------
                var newDirectory = Path.Combine(sandboxPath.FullPath, Guid.NewGuid().ToString());
                fileSystemAdapter.CreateDirectory(newDirectory);
                //---------------Test Result -----------------------
                Assert.IsTrue(fileSystemAdapter.DirectoryExists(newDirectory));
            }
        }