diff --git a/RestSharp.IntegrationTests/MultipartFormDataTests.cs b/RestSharp.IntegrationTests/MultipartFormDataTests.cs
index b8778e4cd..611fb11ff 100644
--- a/RestSharp.IntegrationTests/MultipartFormDataTests.cs
+++ b/RestSharp.IntegrationTests/MultipartFormDataTests.cs
@@ -1,13 +1,26 @@
-using System;
-using System.Net;
-using NUnit.Framework;
-using RestSharp.IntegrationTests.Helpers;
-
-namespace RestSharp.IntegrationTests
+namespace RestSharp.IntegrationTests
{
+ using System;
+ using System.IO;
+ using System.Net;
+
+ using RestSharp.IntegrationTests.Helpers;
+
+ using Xunit;
+
public class MultipartFormDataTests
{
- [Test]
+ private readonly string expected =
+ "-------------------------------28947758029299" + Environment.NewLine +
+ "Content-Disposition: form-data; name=\"foo\"" + Environment.NewLine + Environment.NewLine +
+ "bar" + Environment.NewLine +
+ "-------------------------------28947758029299" + Environment.NewLine +
+ "Content-Disposition: form-data; name=\"a name with spaces\"" + Environment.NewLine + Environment.NewLine +
+ "somedata" + Environment.NewLine +
+ "-------------------------------28947758029299--" + Environment.NewLine;
+
+
+ [Fact]
public void MultipartFormDataAsync()
{
const string baseUrl = "http://localhost:8888/";
@@ -17,20 +30,19 @@ public void MultipartFormDataAsync()
var client = new RestClient(baseUrl);
var request = new RestRequest("/", Method.POST) { AlwaysMultipartFormData = true };
- AddParameters(request);
+ this.AddParameters(request);
client.ExecuteAsync(request, (restResponse, handle) =>
{
Console.WriteLine(restResponse.Content);
- Assert.AreEqual(Expected, restResponse.Content);
+ Assert.Equal(this.expected, restResponse.Content);
});
}
}
- [Test]
+ [Fact]
public void MultipartFormData()
{
- //const string baseUrl = "http://localhost:8888/";
const string baseUrl = "http://localhost:8888/";
using (SimpleServer.Create(baseUrl, EchoHandler))
@@ -38,38 +50,27 @@ public void MultipartFormData()
var client = new RestClient(baseUrl);
var request = new RestRequest("/", Method.POST) { AlwaysMultipartFormData = true };
- AddParameters(request);
+ this.AddParameters(request);
var response = client.Execute(request);
- //Console.WriteLine(response.Content);
-
- Assert.AreEqual(Expected, response.Content);
+ Assert.Equal(this.expected, response.Content);
}
}
- private void AddParameters(RestRequest request)
- {
- request.AddParameter("foo", "bar");
- request.AddParameter("a name with spaces", "somedata");
- }
-
- private const string Expected =
- "-------------------------------28947758029299\r\n" +
- "Content-Disposition: form-data; name=\"foo\"\r\n\r\n" +
- "bar\r\n" +
- "-------------------------------28947758029299\r\n" +
- "Content-Disposition: form-data; name=\"a name with spaces\"\r\n\r\n" +
- "somedata\r\n" +
- "-------------------------------28947758029299--\r\n";
-
- private void EchoHandler(HttpListenerContext obj)
+ private static void EchoHandler(HttpListenerContext obj)
{
obj.Response.StatusCode = 200;
- var streamReader = new System.IO.StreamReader(obj.Request.InputStream);
+ var streamReader = new StreamReader(obj.Request.InputStream);
obj.Response.OutputStream.WriteStringUtf8(streamReader.ReadToEnd());
}
+
+ private void AddParameters(RestRequest request)
+ {
+ request.AddParameter("foo", "bar");
+ request.AddParameter("a name with spaces", "somedata");
+ }
}
-}
+}
\ No newline at end of file
diff --git a/RestSharp.IntegrationTests/RestSharp.IntegrationTests.csproj b/RestSharp.IntegrationTests/RestSharp.IntegrationTests.csproj
index ed32cde0b..e40d4ddae 100644
--- a/RestSharp.IntegrationTests/RestSharp.IntegrationTests.csproj
+++ b/RestSharp.IntegrationTests/RestSharp.IntegrationTests.csproj
@@ -62,9 +62,6 @@
AllRules.ruleset
-
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
3.5
diff --git a/RestSharp.IntegrationTests/packages.config b/RestSharp.IntegrationTests/packages.config
index 97c804658..998913d1d 100644
--- a/RestSharp.IntegrationTests/packages.config
+++ b/RestSharp.IntegrationTests/packages.config
@@ -1,6 +1,5 @@
-
\ No newline at end of file
diff --git a/RestSharp.Net4/RestSharp.Net4.csproj b/RestSharp.Net4/RestSharp.Net4.csproj
index 461f443b0..4447027bc 100644
--- a/RestSharp.Net4/RestSharp.Net4.csproj
+++ b/RestSharp.Net4/RestSharp.Net4.csproj
@@ -38,9 +38,6 @@
true
-
- ..\packages\NUnit.2.6.3\lib\nunit.framework.dll
-
diff --git a/RestSharp.Net4/packages.config b/RestSharp.Net4/packages.config
index 967502dc8..6b8deb9c9 100644
--- a/RestSharp.Net4/packages.config
+++ b/RestSharp.Net4/packages.config
@@ -1,4 +1,3 @@
-
\ No newline at end of file