public async Task <WrapperSimpleTypesDTO> VerificarSiUsuarioYaExiste(Usuarios usuarioParaVerificar) { using (SportsGoEntities context = new SportsGoEntities(false)) { AuthenticateRepository authenticateRepo = new AuthenticateRepository(context); WrapperSimpleTypesDTO wrapperExisteUsuario = await authenticateRepo.VerificarSiUsuarioYaExiste(usuarioParaVerificar); return(wrapperExisteUsuario); } }
public async Task AuthenticateRepository_VerificarSiUsuarioYaExiste_ShouldVerify() { using (SportsGoEntities context = new SportsGoEntities(false)) { AuthenticateRepository authenticateRepo = new AuthenticateRepository(context); Usuarios usuarioParaCrear = new Usuarios { Usuario = "Sergio", }; WrapperSimpleTypesDTO wrapperExisteUsuario = await authenticateRepo.VerificarSiUsuarioYaExiste(usuarioParaCrear); Assert.IsNotNull(wrapperExisteUsuario); Assert.IsTrue(wrapperExisteUsuario.Existe); Assert.AreNotEqual(wrapperExisteUsuario.NumeroRegistrosAfectados, 0); } }