示例#1
0
        public void TestXboxDirectoryCopyXboxPCCallsXboxDirectoryInfoCopyCorrectly()
        {
            bool success = false;
            IProgress <XboxFileTransferMetric> expectedProgress = null;

            ShimXboxPath.HasXboxOriginString = path => true;
            ShimXboxDirectoryInfo.AllInstances.CopyStringIProgressOfXboxFileTransferMetric = (xboxDirectoryInfo, path, metrics) =>
            {
                success = true;

                Assert.AreEqual(this.xboxDirectoryPath.FullName, xboxDirectoryInfo.FullName, "Copy didn't pass on the correct directory.");
                Assert.AreEqual(this.pcDirectory, path, "Copy didn't pass on the correct xbox directory.");
                Assert.AreSame(expectedProgress, metrics, "Copy didn't pass on the same progress object.");
            };

            XboxDirectory.Copy(this.xboxDirectoryPath, this.pcDirectory, this.XboxConsole);
            Assert.IsTrue(success, "XboxDirectoryInfo.Copy wasn't called.");

            XboxDirectory.Copy(this.xboxDirectoryPath, this.pcDirectory, this.XboxConsole, null);

            expectedProgress = new Progress <XboxFileTransferMetric>();
            XboxDirectory.Copy(this.xboxDirectoryPath, this.pcDirectory, this.XboxConsole, expectedProgress);
        }
示例#2
0
        public void TestXboxDirectoryCopyPCXboxCallsDirectoryInfoCopyToCorrectly()
        {
            bool success = false;
            IProgress <XboxFileTransferMetric> expectedProgress = null;

            ShimXboxPath.HasXboxOriginString = path => true;
            ShimDirectoryInfoExtensions.CopyToDirectoryInfoXboxPathXboxConsoleIProgressOfXboxFileTransferMetric = (directoryInfo, xboxPath, console, metrics) =>
            {
                success = true;
                Assert.AreEqual(this.pcDirectory, directoryInfo.FullName, "Copy didn't pass on the correct directory.");
                Assert.AreEqual(this.xboxDirectoryPath, xboxPath, "Copy didn't pass on the correct xbox directory.");
                Assert.AreSame(expectedProgress, metrics, "Copy didn't pass on the same progress object.");
                return(null);
            };

            XboxDirectory.Copy(this.pcDirectory, this.xboxDirectoryPath, this.XboxConsole);
            Assert.IsTrue(success, "DirectoryInfo.CopyTo wasn't called.");

            XboxDirectory.Copy(this.pcDirectory, this.xboxDirectoryPath, this.XboxConsole, null);

            expectedProgress = new Progress <XboxFileTransferMetric>();
            XboxDirectory.Copy(this.pcDirectory, this.xboxDirectoryPath, this.XboxConsole, expectedProgress);
        }
示例#3
0
 public void TestXboxDirectoryCopyPCXboxNotSupportedDestinationDirectory()
 {
     ShimXboxPath.HasXboxOriginString = path => false;
     XboxDirectory.Copy(this.pcDirectory, this.xboxDirectoryPath, this.XboxConsole);
 }
示例#4
0
 public void TestXboxDirectoryCopyPCXboxArgumentNullDestinationDirectory()
 {
     XboxDirectory.Copy(this.pcDirectory, null, this.XboxConsole);
 }
示例#5
0
 public void TestXboxDirectoryCopyXboxPCNotSupportedSourceDirectory()
 {
     ShimXboxPath.HasXboxOriginString = path => false;
     XboxDirectory.Copy(this.xboxDirectoryPath, this.pcDirectory, this.XboxConsole);
 }
示例#6
0
 public void TestXboxDirectoryCopyXboxPCArgumentNullSourceDirectory()
 {
     XboxDirectory.Copy(null, this.pcDirectory, this.XboxConsole);
 }