public void ParsingCommandFails() { // Arrange var cmd = new IDN(); var data = "Not a valid ID string"; // Act var result = cmd.Parse(Encoding.ASCII.GetBytes(data)); // Assert Assert.False(result); }
public void ValidCommand() { // Arrange var cmd = new IDN(); var expected = "*IDN?"; // Act var actual = cmd.Command(); // Assert Assert.Equal(expected, actual); }
public void ParsingCommandSucceeds() { // Arrange var cmd = new IDN(); var data = "RIGOL TECHNOLOGIES, DS1054Z, DS1ZA000000000, 00.04.04.SP3\n"; // Act var result = cmd.Parse(Encoding.ASCII.GetBytes(data)); // Assert Assert.True(result); }
/// <summary> /// Perform any formatting for the registry needed to convert /// non-simple-DNS elements /// </summary> /// <param name="element">element to encode</param> /// <returns>an encoded string</returns> public static string EncodeForRegistry(string element) { return(IDN.ToASCII(element)); }