public void NewStateHasHomeDirectory() { var state = new FileSystemState(); var home = state.GetHomeDirectory(); Assert.IsNotNull(home); }
public void HomeDirectoryStartsWithNoFiles() { var state = new FileSystemState(); var home = state.GetHomeDirectory(); Assert.IsNotNull(home.FilesInDirectory); Assert.IsEmpty(home.FilesInDirectory); }
public void NewStateHomeDirectoryIsCurrentDirectory() { var state = new FileSystemState(); var home = state.GetHomeDirectory(); var current = state.GetCurrentDirectory(); Assert.AreEqual(home, current); }
public void HomeDirectoryHasRootParentDirectory() { var state = new FileSystemState(); var home = state.GetHomeDirectory(); var root = state.GetRootDirectory(); Assert.IsNotNull(home.ParentDirectory); Assert.AreEqual(home.ParentDirectory, root); }
public void NewStateHasHomeDirectoryNamedHome() { var state = new FileSystemState(); var expected = "home"; var home = state.GetHomeDirectory(); Assert.IsNotNull(home); Assert.AreEqual(home.Name, expected); }
public void InitializeFileSystemState( FileSystemState fileSystemState, PermissionController permissionController, DirectoryController directoryController) { // TODO - Make it so that all actions are permission based (add requires write access, so does delete, need read access to look at anything, execute to run something, etc) var home = fileSystemState.GetHomeDirectory(); var planetDirectoryPermission = permissionController.GetCustomPermission(canRead: true, canExecute: true); var isAddPlanetDirectorySuccess = directoryController.TryAddDirectory("planets", planetDirectoryPermission, home, out _); Debug.Assert(isAddPlanetDirectorySuccess, $"Failed to add `planets` directory under `{home.Name}` directory"); }