public async Task PersistAsync(string data, InOutOptions options) { if (ThrowBehavior.HasFlag(ThrowOption.ThrowOnPersist)) { throw new IOException($"Mock exception has been thrown at {this.GetType().Name}"); } await Task.Delay(Duration); return; }
public async Task <string> FetchAsync(InOutOptions options = InOutOptions.None) { if (ThrowBehavior.HasFlag(ThrowOption.ThrowOnFetch)) { throw new IOException($"Mock exception has been thrown at {this.GetType().Name}"); } await Task.Delay(Duration); return(await File.ReadAllTextAsync("../fetch.json")); }