Esempio n. 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 CommandResponseMessageJsonEncoder(wrappedEncoder);

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

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