Esempio n. 1
0
        public void TestServiceUpdateStades()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();

            List <StadeWS> stades = client.getStades();

            Assert.IsNotNull(stades);
            StadeWS kamino = client.getStades().Find(x => x.Planete.Equals("Kamino"));

            kamino.NbPlaces = 10;
            client.updateStade(kamino);
            Assert.AreEqual(10, ((StadeWS)client.getStades().Find(x => x.Planete.Equals("Kamino"))).NbPlaces);
            kamino.NbPlaces = 100000;
            client.updateStade(kamino);
            Assert.AreEqual(100000, ((StadeWS)client.getStades().Find(x => x.Planete.Equals("Kamino"))).NbPlaces);

            client.Close();
        }
Esempio n. 2
0
        public void TestServiceARStades()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();

            List <StadeWS> stades = client.getStades();
            int            size   = stades.Count;

            Assert.IsNotNull(stades);
            /* AJOUT */
            StadeWS zone = new StadeWS(0, "Zone TEST", 11, new List <CaracteristiqueWS>());

            client.addStade(zone);
            Assert.AreEqual(size + 1, client.getStades().Count);
            /* SUPPRESSION */
            zone = client.getStades().Find(x => x.Planete.Equals("Zone TEST"));
            client.removeStade(zone);
            Assert.AreEqual(size, client.getStades().Count);

            client.Close();
        }
Esempio n. 3
0
        public void TestServiceGetStades()
        {
            ServiceReference.ServiceClient client = new ServiceReference.ServiceClient();
            List <StadeWS> stades = client.getStades();

            Assert.IsNotNull(stades);
            StadeWS kamino = stades.Find(x => x.Planete.Equals("Kamino"));

            Assert.AreEqual(2, kamino.Caracteristiques.Count);
            Assert.IsNotNull(kamino);
            client.Close();
        }
Esempio n. 4
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();
        }