Example #1
0
        //Listado Tipo Documento
        public List <TipoDocumentoEntity> ListarTipoDocumento_DAL()
        {
            List <TipoDocumentoEntity> listado = new List <TipoDocumentoEntity>();

            SqlCommand cmd = new SqlCommand("SP_VEH_TipoDocumento", cn.getcn);

            cmd.CommandType = CommandType.StoredProcedure;

            cn.getcn.Open();

            SqlDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                TipoDocumentoEntity clase = new TipoDocumentoEntity();
                clase.smiddetalle  = int.Parse(dr["smiddetalle"].ToString());
                clase.vdescripcion = dr["vdescripcion"].ToString();

                listado.Add(clase);
            }

            dr.Close();
            cmd.Dispose();
            cn.getcn.Close();

            return(listado);
        }
Example #2
0
        public async Task TipoDocumento_Get_Test_Full()
        {
            var areaRepoMock = new Mock <ITipoDocumentoRepositorio>();
            var entity       = new TipoDocumentoEntity
            {
                Id = Guid.NewGuid(),
                NombreTipoDocumento = "NombreTipoDocumento"
            };

            areaRepoMock
            .Setup(m => m.SearchMatchingOneResult(It.IsAny <Expression <Func <TipoDocumentoEntity, bool> > >()))
            .Returns(entity);

            var service = new ServiceCollection();

            service.AddTransient(_ => areaRepoMock.Object);

            service.ConfigureGenericasService(new DbSettings());
            var provider             = service.BuildServiceProvider();
            var tipoDocumentoService = provider.GetRequiredService <ITipoDocumentoService>();

            var result = await tipoDocumentoService.Get(new TipoDocumentoRequestDto
            {
                Id = Guid.NewGuid(),
            }).ConfigureAwait(false);

            Assert.NotNull(result.ToString());
            Assert.Equal(entity.Id, result.Id);
        }
        private static Mock <ITipoDocumentoRepositorio> MockTipoDocumentoFull()
        {
            var areaRepoMock = new Mock <ITipoDocumentoRepositorio>();
            var entity       = new TipoDocumentoEntity
            {
                Id = Guid.NewGuid(),
                NombreTipoDocumento = "NombreTipoDocumento"
            };

            areaRepoMock
            .Setup(m => m.SearchMatchingOneResult(It.IsAny <Expression <Func <TipoDocumentoEntity, bool> > >()))
            .Returns(entity);
            return(areaRepoMock);
        }
Example #4
0
 public void Update(TipoDocumentoEntity t)
 {
     throw new NotImplementedException();
 }
Example #5
0
 public int Insert(TipoDocumentoEntity t)
 {
     throw new NotImplementedException();
 }