1 using Microsoft.VisualStudio.TestTools.UnitTesting;
5 using System.Threading;
6 using System.Threading.Tasks;
26 var tmp = (file.
Path?.StartsWith(
'/') ??
false) ?
'.' + file.
Path : file.
Path;
27 var path = Path.Combine(
instance.
Path,
"Configuration", tmp);
28 return File.Exists(path);
36 Path =
"/TestDeleteDir" 44 Content = Encoding.UTF8.GetBytes(
"Hello world!"),
45 Path = TestDir.
Path +
"/test.txt" 46 }, cancellationToken).ConfigureAwait(
false);
58 public async Task
Run(CancellationToken cancellationToken)
Task< ConfigurationFile > Write(ConfigurationFile file, CancellationToken cancellationToken)
Overwrite a ConfigurationFile file
readonly Api.Models.Instance instance
readonly IConfigurationClient configurationClient
string Path
The path to where the Instance is located. Can only be changed while the Instance is offline....
string Path
The path to the ConfigurationFile file
async Task TestDeleteDirectory(CancellationToken cancellationToken)
Task DeleteEmptyDirectory(ConfigurationFile directory, CancellationToken cancellationToken)
Delete an empty directory
Represents a game configuration file. Create and delete actions uncerimonuously overwrite/delete file...
Occurs when the client performs an action that would result in data conflict
For managing ConfigurationFile files
bool FileExists(ConfigurationFile file)
ConfigurationTest(IConfigurationClient configurationClient, Api.Models.Instance instance)
async Task Run(CancellationToken cancellationToken)