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); }
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); }
public void TestXboxFileCopyPCXboxNotSupportedDestinationFile() { ShimXboxPath.HasXboxOriginString = path => false; XboxFile.Copy(this.pcFile, this.xboxFilePath, this.XboxConsole); }
public void TestXboxFileCopyPCXboxArgumentNullDestinationFile() { XboxFile.Copy(this.pcFile, null, this.XboxConsole); }
public void TestXboxFileCopyXboxPCNotSupportedSourceFile() { ShimXboxPath.HasXboxOriginString = path => false; XboxFile.Copy(this.xboxFilePath, this.pcFile, this.XboxConsole); }
public void TestXboxFileCopyXboxPCArgumentNullSourceFile() { XboxFile.Copy(null, this.pcFile, this.XboxConsole); }