public void resubscribeObserver() { if (user.loggedIn) { user.subscribeAsObserver(this); } }
private void closeStoreOnconnecectMessage() { try { myInit(); bool closeAns = godObject.removeStore(storeId, storeOwner1Id); Assert.IsTrue(closeAns, "can't close store"); //store owner test bool subscribe = storeOwnerUser.subscribeAsObserver(ownerObserver); Assert.IsTrue(subscribe, "can't subscribe"); //make sure no messages received on conncet bool noMessages = ownerObserver.msg.Count != 0; Assert.IsTrue(noMessages, "don't have messages on recieve"); //admin test bool adminSubscribe = adminUserL.subscribeAsObserver(adminObserver); Assert.IsTrue(adminSubscribe, "can't subscribe admin"); bool adminMsg = adminObserver.msg.Count != 0; Assert.IsTrue(adminMsg, "admin didn't reveive any messages"); } finally { myCleanUp(); } }
public void HappyConnectNoMessages() { myInit(); //close store bool subscribe = storeOwnerUser.subscribeAsObserver(ownerObserver); Assert.IsTrue(subscribe, "can't subscribe"); //make sure no messages received on conncet bool noMessages = ownerObserver.msg.Count == 0; Assert.IsTrue(noMessages, "have messages on recieve"); myCleanUp(); }