public void ArrayTest_Success()
        {
            var context = new tpvenlanubecalendarEntities();

               // clients toAdd = new clients();
               var sortedClients = from t in context.clients orderby t.clientId ascending select t.clientId;

               // var sortedClients = context.clients.clientId.ToArray();

            var maxId = sortedClients.Max();

            var sortedArray = sortedClients.ToArray();

            Assert.IsTrue(maxId > sortedArray[sortedArray.Length - 2]);
        }
Beispiel #2
0
        public long MaxClientsId()
        {
            var context = new tpvenlanubecalendarEntities();

            // clients toAdd = new clients();
            var sortedClients = from t in context.clients orderby t.clientId ascending select t.clientId;

            // var sortedClients = context.clients.clientId.ToArray();

            var maxId = sortedClients.Max();

            //var sortedArray = sortedClients.ToArray();

            return maxId;
        }
Beispiel #3
0
        public long MaxClientsId()
        {
            var context = new tpvenlanubecalendarEntities();

            // clients toAdd = new clients();
            var sortedClients = from t in context.clients orderby t.clientId ascending select t.clientId;

            // var sortedClients = context.clients.clientId.ToArray();

            var maxId = sortedClients.Max();

            //var sortedArray = sortedClients.ToArray();

            return(maxId);
        }
        public void DeleteTest_Succes()
        {
            var context = new tpvenlanubecalendarEntities();

            var count = context.clients.Count();

            var deleteOrderClients = from clients in context.clients where
                                     clients.clientId == 100 select clients;

            foreach (var client in deleteOrderClients)
            {
                context.clients.Remove(client);
            }
            context.SaveChanges();

            var count2 = context.clients.Count();

            Assert.AreNotEqual(count2, count);
        }
        public void AddTest_Succes()
        {
            var context = new tpvenlanubecalendarEntities();

            clients toAdd = new clients();
            toAdd.clientId = 100;
            toAdd.clientName = "Charo";
            toAdd.clientPicture = string.Empty;
            toAdd.contactNumber = "56524";
            toAdd.lastProduct = "suavizante";
            toAdd.lastService = "corte";

            context.clients.Add(toAdd);

            context.SaveChanges();
            var result = context.clients.FirstOrDefault(s => s.clientName == "Manuel");

            Assert.IsNotNull(result);
        }
 public void ReadTest_Succes()
 {
     var context = new tpvenlanubecalendarEntities();
     var firstClient = context.clients.First();
     Assert.IsTrue(firstClient != null);
 }
Beispiel #7
0
 public List<clients> GetClients()
 {
     var context = new tpvenlanubecalendarEntities();
     return context.clients.clientId.Tolist();
 }