public AsciiResponse ProccessRequest(AsciiRequest request) { string original = request.stringToModify; char[] chars = original.ToCharArray(); string finalOut = ""; foreach (char conversion in chars) { finalOut = finalOut + (Convert.ToInt32(conversion)) + " "; } AsciiResponse response = new AsciiResponse(); response.originalString = original; response.modifiedString = finalOut; return(response); }
public IActionResult AsciiControl([FromBody] AsciiRequest request) { AsciiResponse asciiResponse; try { //_bin.ValidateRequest(request); string[] words = request.stringToModify.Split(' '); Thread thread1 = new Thread(() => ControllerHelperFunctions.databaseWordTransaction(words, _DB)); thread1.Start(); asciiResponse = _ascii.ProccessRequest(request); } catch (Exception e) { return(StatusCode(500, e.Message)); } return(StatusCode(200, asciiResponse)); }
public void Setup() { request = new AsciiRequest(); response = new AsciiResponse(); ascii = new Ascii(); }