public void TestXboxDirectoryInfoDeleteBooleanCallsRefresh() { bool calledDeleteDirectory = false; this.shimAdapter.DeleteDirectoryStringXboxPathBoolean = (systemIpAddress, path, isRecursive) => { calledDeleteDirectory = true; }; bool success = false; ShimXboxFileSystemInfo.AllInstances.Refresh = info => { success = true; Assert.IsTrue(calledDeleteDirectory); }; ShimXboxFileSystemInfoDefinition xboxFileShim = new ShimXboxFileSystemInfoDefinition() { PathGet = () => new XboxPath(@"xd:\directory", XboxOperatingSystem.System) }; ShimXboxFileSystemInfo.ExistsImplStringXboxPathFuncOfXboxFileSystemInfoDefinitionBooleanXboxConsoleAdapterBase = (address, xboxPath, existsPredicate, adapter) => true; XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(xboxFileShim, this.XboxConsole); directoryInfo.Delete(false); Assert.IsTrue(success); }
public void TestXboxDirectoryInfoDeleteThrowsRootDirectory() { ShimXboxFileSystemInfoDefinition xboxFileShim = new ShimXboxFileSystemInfoDefinition() { PathGet = () => new XboxPath(@"xd:\", XboxOperatingSystem.System) }; XboxDirectoryInfo directoryInfo = new XboxDirectoryInfo(xboxFileShim, this.XboxConsole); directoryInfo.Delete(); }