public void TestToString()
        {
            var enc1 = Encoding.ASCII;
            var enc2 = Encoding.Unicode;

            var mes      = new MultiEncodingString("string", "otherString");
            var otherMes = new MultiEncodingString(new[] { new KeyValuePair <Encoding, string>(enc1, "string"),
                                                           new KeyValuePair <Encoding, string>(enc2, "otherString") });

            Assert.Equal("string", mes.ToString(enc1));
            Assert.Equal("otherString", mes.ToString(enc2));

            Assert.Equal("string", otherMes.ToString(enc1));
            Assert.Equal("otherString", otherMes.ToString(enc2));
        }
Ejemplo n.º 2
0
 private TimeUnit(MultiEncodingString name, string description, long nanosecondAmount)
 {
     this.name        = name;
     Description      = description;
     NanosecondAmount = nanosecondAmount;
 }