mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-21 17:10:26 +01:00
Initial code (copy)
This commit is contained in:
42
test/WireMock.Net.Tests/RequestTests.cs
Normal file
42
test/WireMock.Net.Tests/RequestTests.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using NFluent;
|
||||
using NUnit.Framework;
|
||||
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1600:ElementsMustBeDocumented",
|
||||
Justification = "Reviewed. Suppression is OK here, as it's a tests class.")]
|
||||
[module:
|
||||
SuppressMessage("StyleCop.CSharp.DocumentationRules",
|
||||
"SA1633:FileMustHaveHeader",
|
||||
Justification = "Reviewed. Suppression is OK here, as unknown copyright and company.")]
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace WireMock.Net.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class RequestTests
|
||||
{
|
||||
[Test]
|
||||
public void Should_handle_empty_query()
|
||||
{
|
||||
// given
|
||||
var request = new Request("/foo", string.Empty, "blabla", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(request.GetParameter("foo")).IsEmpty();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Should_parse_query_params()
|
||||
{
|
||||
// given
|
||||
var request = new Request("/foo", "foo=bar&multi=1&multi=2", "blabla", "whatever", new Dictionary<string, string>());
|
||||
|
||||
// then
|
||||
Check.That(request.GetParameter("foo")).Contains("bar");
|
||||
Check.That(request.GetParameter("multi")).Contains("1");
|
||||
Check.That(request.GetParameter("multi")).Contains("2");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user