AuctionSniper.Acceptance.Tests.SingleMessageListener.ReceivesAMessageFrom C# (CSharp) Method

ReceivesAMessageFrom() public method

public ReceivesAMessageFrom ( string sniperXmppId, Constraint constraint, string message ) : void
sniperXmppId string
constraint Constraint
message string
return void
        public void ReceivesAMessageFrom(string sniperXmppId, Constraint constraint, string message)
        {
            Message msg;
            TimeSpan timeout = 4.Seconds();
            Assert.That(messages.TryTake(out msg, timeout), String.Format("did not receive message from sniper within {0} seconds", timeout));
            Assert.That(msg.From.User, Is.EqualTo(sniperXmppId), "message was not from {0}", sniperXmppId);
            Assert.That(msg.Body, constraint, message);
            SniperJid = msg.From;
        }

Usage Example

Beispiel #1
0
        public void HasReceivedJoinRequestFrom(string xmppId)
        {
            object join_message;

            singleMessageListener.ReceivesAMessageFrom(xmppId, Is.EqualTo(JOIN_COMMAND), "did not receive join message");
        }