Пример #1
0
        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);
        }
Пример #2
0
        public void ValidCommand()
        {
            // Arrange
            var cmd      = new IDN();
            var expected = "*IDN?";

            // Act
            var actual = cmd.Command();

            // Assert
            Assert.Equal(expected, actual);
        }
Пример #3
0
        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);
        }
Пример #4
0
 /// <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));
 }