Пример #1
0
        public void TestAddPrime()
        {
            List <User> lst = clientService.SearchUser("del");



            if (lst.Count >= 1)
            {
                User me = lst[0];

                Prime prime = new Prime()
                {
                    User_id   = me.Id,
                    Price     = 2000,
                    StartDate = DateTime.Now,
                    EndDate   = DateTime.Now,
                    Label     = "Yolo prime"
                };

                Assert.IsTrue(clientService.addPrime(me.Id, prime));

                lst = clientService.SearchUser("del");
                me  = lst[0];

                int nbPrime = clientService.GetPrimesByUserId(me.Id).Count;

                Assert.AreEqual(me.Primes.Count, nbPrime);
            }
        }
Пример #2
0
 private async void InitializePrimes()
 {
     try
     {
         var primes = ServiceSalaire.GetPrimesByUserId(Employee.Id);
         Employee.Primes = primes;
     }
     catch (Exception) { }
 }