示例#1
0
        public void should_check_if_message_sent()
        {
            //arrange
            var    expected      = "text";
            var    sender        = new MessageSender();
            string raisedMessage = null;

            sender.MessageAvailable += (obj, args) => raisedMessage = args.Message;
            //act
            sender.SendMessage(expected);
            //assert
            raisedMessage.Should().Be(expected);
        }
示例#2
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");
        }
示例#3
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");
        }
示例#4
0
 public void should_check_if_message_sent()
 {
     //arrange
     var expected = "text";
     var sender = new MessageSender();
     string raisedMessage = null;
     sender.MessageAvailable += (obj, args) => raisedMessage = args.Message;
     //act
     sender.SendMessage(expected);
     //assert
     raisedMessage.Should().Be(expected);
 }