Esempio n. 1
0
        public void TestXboxFileCopyPCXboxCallsFileInfoCopyToCorrectly()
        {
            IProgress <XboxFileTransferMetric> expectedProgress = null;

            bool success = false;

            ShimXboxPath.HasXboxOriginString = path => true;
            ShimFileInfoExtensions.CopyToFileInfoXboxPathXboxConsoleIProgressOfXboxFileTransferMetric = (fileInfo, xboxPath, console, metrics) =>
            {
                success = true;

                Assert.AreEqual(this.pcFile, fileInfo.FullName, "Copy didn't pass the expected source file path to the adapter.");
                Assert.AreEqual(this.xboxFilePath.FullName, xboxPath.FullName, "Copy didn't pass the expected destination file path to the adapter.");
                Assert.AreSame(expectedProgress, metrics, "Copy didn't pass the expected destination file path to the adapter.");

                return(null);
            };

            XboxFile.Copy(this.pcFile, this.xboxFilePath, this.XboxConsole);
            Assert.IsTrue(success, "FileInfo.CopyTo wasn't called.");

            XboxFile.Copy(this.pcFile, this.xboxFilePath, this.XboxConsole, null);

            expectedProgress = new Progress <XboxFileTransferMetric>();
            XboxFile.Copy(this.pcFile, this.xboxFilePath, this.XboxConsole, expectedProgress);
        }
Esempio n. 2
0
        public void TestXboxFileCopyXboxPCCallsXboxFileInfoCopyCorrectly()
        {
            IProgress <XboxFileTransferMetric> expectedProgress = null;

            bool success = false;

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

                Assert.AreEqual(this.xboxFilePath.FullName, xboxFileInfo.FullName, "Copy didn't pass the expected source file path to the adapter.");
                Assert.AreEqual(this.pcFile, path, "Copy didn't pass the expected destination file path to the adapter.");
                Assert.AreSame(expectedProgress, metrics, "Copy didn't pass the expected destination file path to the adapter.");
            };

            XboxFile.Copy(this.xboxFilePath, this.pcFile, this.XboxConsole);
            Assert.IsTrue(success, "XboxFileInfo.Copy wasn't called.");
            XboxFile.Copy(this.xboxFilePath, this.pcFile, this.XboxConsole, null);

            expectedProgress = new Progress <XboxFileTransferMetric>();
            XboxFile.Copy(this.xboxFilePath, this.pcFile, this.XboxConsole, expectedProgress);
        }
Esempio n. 3
0
 public void TestXboxFileCopyPCXboxNotSupportedDestinationFile()
 {
     ShimXboxPath.HasXboxOriginString = path => false;
     XboxFile.Copy(this.pcFile, this.xboxFilePath, this.XboxConsole);
 }
Esempio n. 4
0
 public void TestXboxFileCopyPCXboxArgumentNullDestinationFile()
 {
     XboxFile.Copy(this.pcFile, null, this.XboxConsole);
 }
Esempio n. 5
0
 public void TestXboxFileCopyXboxPCNotSupportedSourceFile()
 {
     ShimXboxPath.HasXboxOriginString = path => false;
     XboxFile.Copy(this.xboxFilePath, this.pcFile, this.XboxConsole);
 }
Esempio n. 6
0
 public void TestXboxFileCopyXboxPCArgumentNullSourceFile()
 {
     XboxFile.Copy(null, this.pcFile, this.XboxConsole);
 }