public void Empty_Request() { var service = new TicTacToeService(); var serverProperties = new ServerProperties(null, 5555, new ServerTime(), new MockPrinter()); Assert.False(service.CanProcessRequest("", serverProperties)); }
public void Cant_Process_Root(string request) { var service = new TicTacToeService(); var serverProperties = new ServerProperties(null, 5555, new ServerTime(), new MockPrinter()); Assert.False(service.CanProcessRequest(request, serverProperties)); }
public void Can_Process_Root(string requestListing) { var request = requestListing + "\r\n" + "Host: localhost:8080\r\n" + "Connection: keep-alive\r\n" + "Content-Length: 33\r\n" + "Cache-Control: max-age = 0\r\n" + "Accept: text / html,application / xhtml + xml,application / xml; q = 0.9,image / webp,*;q=0.8\r\n" + "Origin: http://localhost:8080\r\n" + "Upgrade-Insecure-Requests: 1\r\n" + "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\r\n" + "Content-Type: application/JSON\r\n" + "Referer: http://localhost:8080/form\r\n" + "Accept-Encoding: gzip, deflate\r\n" + "Accept-Language: en-US,en;q=0.8\r\n\r\n"; var service = new TicTacToeService(); var serverProperties = new ServerProperties(null, 5555, new ServerTime(), new MockPrinter()); Assert.True(service.CanProcessRequest(request, serverProperties)); }