//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); }
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); }
public void Update(TipoDocumentoEntity t) { throw new NotImplementedException(); }
public int Insert(TipoDocumentoEntity t) { throw new NotImplementedException(); }