public async STT.Task ResetTest() { var mock = new M.Mock <IOperation>(); var option = new AO.Reset(); mock.Setup(op => op.Reset(M.It.IsAny <AO.Reset>())).Returns(A.Utility.TaskExitSuccess); Assert.Equal(ExitCode.Success, await AT.Utility.FromOk(option.Operate(mock.Object)).ConfigureAwait(false)); mock.Verify(op => op.Reset(option)); }
/** * <summary> * Delete configuration. * </summary> * <param name="options">Reset options.</param> * <returns>Possible task yielding exit code.</returns> * <exception cref='OperationIOException'>Unable to access file for deletion.</exception> */ public virtual ST.Result <STT.Task <ExitCode> > Reset(AO.Reset options) => Effect.DeleteFile(Environment.ConfigurationFile) .Select(task => task.CombineAsync(Utility.TaskExitSuccess));