Ejemplo n.º 1
0
        public void ConnectionReceived_WhenCalledWith_ShouldSet()
        {
            var session = Mock.Create <ISession>();

            Mock.Raise(() =>
                       _nodeGateway.ConnectionReceived += null, session);

            Mock.Assert(() => _sessionHolder.Set(session), Occurs.Exactly(1));
        }
Ejemplo n.º 2
0
        public void Set_WhenCalled_ShouldSubscribeOnSession()
        {
            var session = Mock.Create <ISession>();

            session.ArrangeSet(x => x.Closed    += null).IgnoreArguments().Occurs(1);
            session.ArrangeSet(x => x.Received  += null).IgnoreArguments().Occurs(1);
            session.ArrangeSet(x => x.Responded += null).IgnoreArguments().Occurs(1);

            _sut.Set(session);

            session.AssertAll();
        }