コード例 #1
0
        public void TestXboxDirectoryInfoCopyXboxToXbox()
        {
            ShimXboxDirectoryInfo.AllInstances.ExistsGet = info => true;
            XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(new ShimXboxFileSystemInfoDefinition(), this.XboxConsole);

            directoryInfo.Copy(@"xd:\directory");
        }
コード例 #2
0
        public void TestXboxDirectoryInfoCopyDirectoryDoesNotExist()
        {
            XboxDirectoryInfo     directoryInfo     = new XboxDirectoryInfo(@"xd:\test", XboxOperatingSystem.System, this.XboxConsole);
            ShimXboxDirectoryInfo shimDirectoryInfo = new ShimXboxDirectoryInfo(directoryInfo)
            {
                ExistsGet = () => false
            };

            directoryInfo.Copy(@"c:\test");
        }
コード例 #3
0
        public void TestXboxDirectoryInfoCopyDefaultIsRecursive()
        {
            bool success = false;

            ShimXboxFileSystemInfo.AllInstances.ExistsGet        = info => true;
            ShimXboxDirectoryInfo.AllInstances.CopyStringBoolean = (dirInfo, localPath, isRecursive) =>
            {
                success = true;
                Assert.IsTrue(isRecursive);
            };

            XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(new ShimXboxFileSystemInfoDefinition(), this.XboxConsole);

            directoryInfo.Copy(@"C:\test");
            Assert.IsTrue(success);
        }
コード例 #4
0
        public void TestXboxDirectoryInfoCopyCreatesDirectoryIfItDoesNotExist()
        {
            bool success = false;

            ShimXboxFileSystemInfoDefinition xboxFileShim = new ShimXboxFileSystemInfoDefinition()
            {
                PathGet = () => new XboxPath(@"xd:\directory", XboxOperatingSystem.System)
            };

            ShimDirectory.ExistsString          = s => false;
            ShimDirectory.CreateDirectoryString = path =>
            {
                success = true;
                return(null);
            };

            ShimXboxDirectoryInfo.AllInstances.ExistsGet = info => true;
            XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(xboxFileShim, this.XboxConsole);

            directoryInfo.Copy(@"c:\directory");

            Assert.IsTrue(success);
        }
コード例 #5
0
        public void TestXboxDirectoryInfoCopyNullDirectory()
        {
            XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(new ShimXboxFileSystemInfoDefinition(), this.XboxConsole);

            directoryInfo.Copy(null);
        }