Exemplo n.º 1
0
        public void GetByFeatureClient()
        {
            List <Client> getByFeature;

            using (var db = new EntitesContext())
            {
                ClearTable.Features(db);
                ClearTable.KeyFeatures(db);
                ClearTable.Clients(db);
                ClearTable.KeyFeatureClients(db);

                clientL = Get(db);
                db.Features.AddRange(CreateListEntities.Features());
                db.KeyFeatures.AddRange(CreateListEntities.KeyFeatures());
                db.Clients.AddRange(CreateListEntities.Clients());
                db.KeyFeatureClients.AddRange(CreateListEntities.KeyFeatureClients());
                db.SaveChanges();

                getByFeature = clientL.GetByFeature(new Feature
                {
                    Id     = 1,
                    Number = 1,
                    Name   = "qwe",
                });
            }

            CollectionAssert.AreEqual(getByFeature, CreateListEntities.Clients());
        }
Exemplo n.º 2
0
 public void GetByNullFeatureClient()
 {
     using (var db = new EntitesContext())
     {
         clientL = Get(db);
         Assert.ThrowsException <ArgumentNullException>(() => clientL.GetByFeature(null));
     }
 }
Exemplo n.º 3
0
        public List <ModelViewClient> GetByFeature(ModelViewFeature feature)
        {
            if (feature == null)
            {
                throw new ArgumentNullException(nameof(feature));
            }

            return(Convert(clientLogic.GetByFeature(feature.Feature)));
        }