예제 #1
0
        public void constructor_should_initialize_instance()
        {
            var textReader      = new StringReader("");
            var textWriter      = new StringWriter();
            var encoderSettings = new MessageEncoderSettings();
            var wrappedEncoder  = new CommandMessageJsonEncoder(textReader, textWriter, encoderSettings);

            var result = new CommandRequestMessageJsonEncoder(wrappedEncoder);

            result._wrappedEncoder().Should().BeSameAs(wrappedEncoder);
        }
예제 #2
0
        public static CommandMessageJsonEncoder _wrappedEncoder(this CommandRequestMessageJsonEncoder obj)
        {
            var fieldInfo = typeof(CommandRequestMessageJsonEncoder).GetField("_wrappedEncoder", BindingFlags.NonPublic | BindingFlags.Instance);

            return((CommandMessageJsonEncoder)fieldInfo.GetValue(obj));
        }