Example #1
0
        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);
        }
Example #2
0
        public void TestXboxDirectoryInfoDeleteThrowsRootDirectory()
        {
            ShimXboxFileSystemInfoDefinition xboxFileShim = new ShimXboxFileSystemInfoDefinition()
            {
                PathGet = () => new XboxPath(@"xd:\", XboxOperatingSystem.System)
            };

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

            directoryInfo.Delete();
        }