(define oneServ ([] ([] "NetServer" alloc) init)) (define newParty ([] "NetParty" alloc)) (greg-testcase "NetParty initialisation" #t (lambda () (equal? ([] newParty initWithName: ($$ "part1") inServer: oneServ) newParty) )) (greg-testcase "NetParty name access" #t (lambda () (equal? ([] newParty name) ($$ "part1")) )) (greg-testcase "NetParty terminate" #t (lambda () ([] newParty terminate) (equal? ([] ([] oneServ partyList) count) 0) )) (greg-testcase "NetParty connection" #t (lambda () ([] newParty connectWithName: ($$ "joueur1")) (equal? ([] newParty nbPlayers) 1) )) (greg-testcase "NetParty disconnection" #t (lambda () (define client ([] ([] ([] "NetInfosClient" alloc) init) newParty clientWithName: ($$ "joueur1"))) ([] newParty disconnect: client) (equal? ([] newParty nbPlayers) 0) ))