Exemple #1
0
        public void TestServiceUpdateMatches()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();

            List <MatchWS> matches = client.getMatches();

            Assert.IsNotNull(matches);
            MatchWS kamino = client.getMatches().Find(x => x.Id.Equals(11));

            kamino.Phase = (EPhaseTournoiWS)5;
            client.updateMatch(kamino);
            Assert.AreEqual((EPhaseTournoiWS)5, ((MatchWS)client.getMatches().Find(x => x.Id.Equals(11))).Phase);
            kamino.Phase = (EPhaseTournoiWS)4;
            client.updateMatch(kamino);
            Assert.AreEqual((EPhaseTournoiWS)4, ((MatchWS)client.getMatches().Find(x => x.Id.Equals(11))).Phase);

            client.Close();
        }
Exemple #2
0
        public void TestServiceGetMatches()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();
            List <MatchWS> matches = client.getMatches();

            Assert.IsNotNull(matches);
            MatchWS combat = matches.Find(x => x.Jedi1.Nom.Equals("Obi Wan Kenobi") && x.Jedi2.Nom.Equals("Yoda"));

            Assert.IsNotNull(combat);
            client.Close();
        }
Exemple #3
0
        public void TestServiceARMatches()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();

            List <MatchWS> matches = client.getMatches();
            List <JediWS>  jedis   = client.getJedis();
            List <StadeWS> stades  = client.getStades();
            int            size    = matches.Count;

            Assert.IsNotNull(matches);
            /* AJOUT */
            MatchWS zone = new MatchWS(0, jedis.ElementAt(0), jedis.ElementAt(3), null, stades.ElementAt(0), EntitiesLayer.EPhaseTournoi.HuitiemeFinale1);

            client.addMatch(zone);
            Assert.AreEqual(size + 1, client.getMatches().Count);
            /* SUPPRESSION */
            zone = client.getMatches().Find(x => x.Jedi1 != null && x.Jedi2 != null && x.Jedi1.Id.Equals(jedis.ElementAt(0).Id) && x.Jedi2.Id.Equals(jedis.ElementAt(3).Id) && x.Stade.Id.Equals(stades.ElementAt(0).Id));
            client.removeMatch(zone);
            Assert.AreEqual(size, client.getMatches().Count);

            client.Close();
        }