コード例 #1
0
        public void constructor_should_initialize_instance()
        {
            var server  = new Mock <IServer>().Object;
            var channel = new Mock <IChannelHandle>().Object;
            var session = new Mock <ICoreSessionHandle>().Object;

            var result = new ChannelChannelSource(server, channel, session);

            result._channel().Should().BeSameAs(channel);
            result._disposed().Should().BeFalse();
            result.Server.Should().BeSameAs(server);
            result.Session.Should().BeSameAs(session);
        }
コード例 #2
0
        public static bool _disposed(this ChannelChannelSource obj)
        {
            var fieldInfo = typeof(ChannelChannelSource).GetField("_disposed", BindingFlags.NonPublic | BindingFlags.Instance);

            return((bool)fieldInfo.GetValue(obj));
        }
コード例 #3
0
        public static IChannelHandle _channel(this ChannelChannelSource obj)
        {
            var fieldInfo = typeof(ChannelChannelSource).GetField("_channel", BindingFlags.NonPublic | BindingFlags.Instance);

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