我正在尝试使用NUnit Console Runner通过命令行运行测试:https : //github.com/nunit/docs/wiki/Console-Runner
我已经在我的NuGet中安装了https://www.nuget.org/packages/NUnit.ConsoleRunner/ NUnit.ConsoleRunner
我在中打开了命令行位置\sanitized\bin\Debug\netcoreapp2.1。我使用https://github.com/nunit/docs/wiki/Console-Command-Line中NUNIT3-CONSOLE myTests.dll提到的命令运行测试
但是我得到了错误:
NUNIT3-CONSOLE:找不到命令
我应该使用什么命令?
注意:这是一个.netcore应用程序
我正在使用 RestSharp 发出包含 JSON 正文的 POST 请求。但我收到错误请求错误。
因为我已经[]在""JSON 中决定使用 Newtonsoft.Json 。在使用它之前,我什至看不到正在形成的 JSON 请求。
我愿意尝试MS httpwebrequest作为替代方案。
restClient = new RestClient();
restRequest = new RestRequest(ApiUrl, Method.POST, DataFormat.Json);
var myObject = "{ \"target\" : \"[5,5]\", \"lastseen\" : \"1555459984\" }";
var json = JsonConvert.SerializeObject(myObject);
restRequest.AddParameter("application/json", ParameterType.RequestBody);
restRequest.AddJsonBody(json);
Run Code Online (Sandbox Code Playgroud)
请注意,我正在尝试将 JSON 卷曲转换为 C#。请看下面:
curl -H 'Content-Type: application/json' -X POST -d '{ "target" : [5, 5], "lastseen" : "1555459984", "previousTargets" : [ [1, 0], [2, 2], [2, 3] ] }' http://santized/santized/santized