m0rkeulv / smartfox-testing

Library that enhances the abilities of testing the SmartFox 2X server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modified version of smecsias smartfox-testing lib.

The only difference (so far) is support for Anotations to tell each test and/or test class what handler class its going to test.

@Test
@HandlerToTest(value = MyHandler.class)
public void testPrivateMessageSendError() {
    User fromUser = player("Guest1");
    User toUser = player("Guest2");
    setPlayersInRoom(fromUser, toUser);

    verifyWhen(
            fromUser,

            doRequest().
                    putString("message", "Hello!").
                    putInt("toUserId", toUser.getId()),
            then(
                    user(toUser).
                            getResponse("privateMessage").
                            putString("message", "Hello!").
                            putInt("fromUserId", fromUser.getId()).
                            withNoUDP()
            )
    );
}

About

Library that enhances the abilities of testing the SmartFox 2X server


Languages

Language:Java 100.0%