예제 #1
0
        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));
        }
예제 #2
0
 /**
  * <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));