public void CreateClientQueues_Test(string str) { Pomocne_funkcijeCreate pfc = new Pomocne_funkcijeCreate(mtf, qf); MyTuple <MyTuple <string, Queue>, MyTuple <string, Queue> > tu = new MyTuple <MyTuple <string, Queue>, MyTuple <string, Queue> >(); tu = pfc.CreateClientQueues(str); MyTuple <string, Queue> tupleA = mtf.CreateNewMyTuple(str + "A", qf); MyTuple <string, Queue> tupleB = mtf.CreateNewMyTuple(str + "B", qf); MyTuple <MyTuple <string, Queue>, MyTuple <string, Queue> > tuple = mtf.CreateNewMyTuple1(tupleA, tupleB); Assert.AreEqual(JsonConvert.SerializeObject(tu), JsonConvert.SerializeObject(tuple)); }
public void CreateNewMyTuple_True(string str, string queueF) { mtf = new MyTupleFactory(); mt = new MyTuple <string, Queue>("String", new Queue()); QueueFactory qf = getObject1(queueF); MyTuple <string, Queue> sd = mtf.CreateNewMyTuple(str, qf); Assert.AreEqual(sd.Item1, mt.Item1); Assert.AreEqual(mt.Item2, sd.Item2); }
public void SubscribeGood() { client = new Clientt("Klijent"); client.Model = new Model(1); client.Trenutan_lobby = new MyTuple <MyTuple <string, System.Collections.Queue>, MyTuple <string, System.Collections.Queue> >(); client.Naziv_trenutnog_lobbyja = "lobby"; server.lista_klijentskih_redova.Add("lobby", mytuplefactory.CreateNewMyTuple1(mytuplefactory.CreateNewMyTuple("lobbyA", queueFactory), mytuplefactory.CreateNewMyTuple("lobbyB", queueFactory))); server.lista_klijentskih_redova.Add("32", mytuplefactory.CreateNewMyTuple1(mytuplefactory.CreateNewMyTuple("32A", queueFactory), mytuplefactory.CreateNewMyTuple("32B", queueFactory))); Clientt client1 = new Clientt("Klijent"); client1.Model = new Model(1); client1.Trenutan_lobby = server.lista_klijentskih_redova["32"]; client1.Naziv_trenutnog_lobbyja = "32"; Assert.AreEqual(JsonConvert.SerializeObject(client1), JsonConvert.SerializeObject(m.Subscribe(pfs, client.Naziv_trenutnog_lobbyja, client.Id, client.Model, client.Naziv_klijenta, false))); }