public void CtorTest(Name name, Command command, Arguments arguments) { var option = new AO.Set(name, command, arguments); Assert.Equal(name, option.Name); Assert.Equal(command, option.Command); Assert.Equal(arguments, option.Arguments); }
/** * <summary> * Set an alias and save configuration. * </summary> * <param name="options">Set options.</param> * <returns>Possible task yielding exit code.</returns> * <exception cref='SerializerException'>Configuration could not be serialized or written to file.</exception> */ public virtual ST.Result <STT.Task <ExitCode> > Set(AO.Set options) { Configuration.Binding[options.Name] = new AC.CommandEntry (options.Command , options.ArgumentString ); return(WriteConfiguration()); }
public async STT.Task SetTest(Name name, Command command, Arguments arguments) { var mock = new M.Mock <IOperation>(); var option = new AO.Set(name, command, arguments); mock.Setup(op => op.Set(M.It.IsAny <AO.Set>())).Returns(A.Utility.TaskExitSuccess); Assert.Equal(ExitCode.Success, await AT.Utility.FromOk(option.Operate(mock.Object)).ConfigureAwait(false)); mock.Verify(op => op.Set(option)); }