コード例 #1
0
        public void EncodeText(string encodingName, string input, string output)
        {
            var encoding = Encoding.GetEncoding(encodingName);

            Assert.NotNull(encoding);
            var sup      = new Md5Codec(encoding);
            var response = sup.Encode(new CodecInput <string> {
                Content = input
            });

            Assert.NotNull(response);
            Assert.Equal(output, response.Content);
        }
コード例 #2
0
        public void ExceptionOnDecode()
        {
            var sup = new Md5Codec(Encoding.UTF8);

            Assert.Throws <NotSupportedException>(() => sup.Decode(new CodecInput <string>()));
        }