示例#1
0
        public void should_check_all_structure()
        {
            //arrange
            var sender = new MessageSender();
            var server = new Server();
            var rec1 = new MessageReceiver();
            var rec2 = new MessageReceiver();

            //act
            rec1.Receive(server);
            rec2.Receive(server);

            //assert
            sender.SendMessage("ku");
        }
示例#2
0
        public void should_receive_message_from_server()
        {
            //arrange
            var server = Substitute.For<Server>();
            var receiver = new MessageReceiver();

            //act
            receiver.Receive(server);
            server.MessageAvailable += Raise.EventWith(new MsgEventArgs{Message = expected});

            //assert
            receiver.ReceivedMessage.Should().Be(expected);
        }