public void TestPosts() { bool error = false; try { ISplitService convierte = new SplitService(); StringCollection collection = new StringCollection() { "andrea", "marte", "guspy", "jesucristoplanet" }; List <Rebelde> listaRebeldes = new RebeldeFactory(convierte).ListRebeldes(collection); ILog log = new Log(); log.CrearLog(listaRebeldes); } catch (Exception e) { error = true; _logger.LogError(e.Message); } Assert.IsFalse(error); }
public RebeldFactoryTests() { Split = new SplitService(); Factory = new RebeldeFactory(Split); _stringCollection = new StringCollection(); _stringCollectionEmpty = new StringCollection(); }
public void ControladorTest(StringCollection collection) { bool objeto = false; try { var listaRebeldes = new RebeldeFactory(splitService).ListRebeldes(collection); } catch (Exception e) { objeto = true; } Assert.IsFalse(objeto); }
public IActionResult Post(StringCollection collection) { ISplitService splitService = new SplitService(); try { var listaRebeldes = new RebeldeFactory(splitService).ListRebeldes(collection); ILog log = new Log(); log.CrearLog(listaRebeldes); return(Ok(listaRebeldes)); } catch (Exception e) { _logger.LogError(e.Message); return(StatusCode(500)); } }
public List <Rebelde> GetListaRebeldes() { ISplitService splitService = new SplitService(); try { var lsitaRebeldes = new RebeldeFactory(splitService); if (lsitaRebeldes.ToString().Equals(" ")) { throw new RepositoryException("lista vacia"); } return(new List <Rebelde>()); } catch (RepositoryException ex) { throw new ServiceException("Error en GetListaRebeldes()", ex); } }