コード例 #1
0
        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;
        }
コード例 #2
0
        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"));
        }