public void doesServerReconcilliationUpdate() { World world = new World(); world.setPlayerPos(new Tuple <int, int>(0, 0)); Player player = new Player(10, 10); Technique technique = new ServerReconcilliation(); technique.update(new Client(true, world, 0), player, world, "7"); string expected = "7"; string result = technique.getLastAction(); Assert.AreEqual(expected, result); }
public void doesServerReconcilliationProcess() { World world = new World(); world.setPlayerPos(new Tuple <int, int>(0, 0)); Player player = new Player(0, 0); Technique technique = new ServerReconcilliation(); Client clnt = new Client(true, world, 0); technique.update(clnt, player, world, "1"); Thread.Sleep(1000); // Wait for packet to be recieved Tuple <int, int> expected = null; // Should match and therefore return nothing Tuple <int, int> result = technique.process(clnt, world); Assert.AreEqual(expected, result); }