public void InterpetrarTextoComMetais() { var resultadoSilver = new ConvertInterGalactical("how many Credits is glob prok Silver ?").ConverterTextoGalactical(); var resultadoGold = new ConvertInterGalactical("how many Credits is glob prok Gold ?").ConverterTextoGalactical(); var resultadoIron = new ConvertInterGalactical("how many Credits is glob prok Iron ?").ConverterTextoGalactical(); Assert.AreEqual("glob prok Silver is 68 Credits", resultadoSilver); Assert.AreEqual("glob prok Gold is 57800 Credits", resultadoGold); Assert.AreEqual("glob prok Iron is 782 Credits", resultadoIron); }
public IHttpActionResult ConverterTextoGalactical(string id) { try { ConvertInterGalactical conversor = new ConvertInterGalactical(id); return(this.Ok(conversor.ConverterTextoGalactical())); } catch (NumerosGalacticaisInvalidoExceptions ex) { return(this.Ok(ex.Message)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void InterpetrarTextoSemMetais() { var resultado = new ConvertInterGalactical("how much is pish tegj glob glob ?").ConverterTextoGalactical(); Assert.AreEqual("pish tegj glob glob is 42", resultado); }