public void SetValue(uint value) { ValueFormat = OptionValueFormat.UInt; RawValue = EndianBitConverter.Big.GetBytes(value); }
public void SetValue(byte[] value) { ValueFormat = OptionValueFormat.Opaque; RawValue = value; }
public void SetValue(string value) { ValueFormat = OptionValueFormat.String; RawValue = Encoding.UTF8.GetBytes(value); }
public CoapOption(Option number, uint value) { Number = number; RawValue = EndianBitConverter.Big.GetBytes(value); ValueFormat = OptionValueFormat.UInt; }
public CoapOption(Option number, string value) { Number = number; RawValue = Encoding.UTF8.GetBytes(value); ValueFormat = OptionValueFormat.String; }
public CoapOption(Option number, byte[] value) { Number = number; RawValue = value; ValueFormat = OptionValueFormat.Opaque; }
// TODO validate what option can use what types public CoapOption(Option number) { Number = number; RawValue = new byte[] { }; ValueFormat = OptionValueFormat.Empty; }
private static void ShouldOutputHelp(string program, string[] commands, OptionValueFormat optionValueFormat, string expected) { var command = new TestWorkerCommand { TestWriter = new TestWriter() }; command.Execute(program, commands, new[] { "?" }, new CmdLineSettings { OptionValueFormat = optionValueFormat }); command.TestWriter.ToString().ShouldBe(expected); }