Beispiel #1
0
        public void Given_InstanciaRepositorio_When_FindEntity_Then_ReturnEntity()
        {
            Personal result;
            Expression <Func <Personal, bool> > criteria = c => c.Id == 7;

            using (var repository = new RepositoryEF(new CSIContext(connectionString)))
            {
                result = repository.FindEntity <Personal>(criteria);
            }
            Assert.IsNotNull(result);
        }
        public void Given_InstanciaRepositorio_When_FindEntity_Then_ReturnEntity()
        {
            Personal result;
            var      parameters = new[]
            {
                new SqlParameter("@Id", System.Data.SqlDbType.Int)
                {
                    Direction = System.Data.ParameterDirection.Input,
                    Value     = 7
                }
            };

            using (var repository = new RepositoryEF(new CSIContext(connectionString)))
            {
                result = repository.FindEntity <Personal>("ObtenerPersona", parameters);
            }
            Assert.IsNotNull(result);
        }