forked from bonesoul/uhttpsharp
-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathHttpMethodProviderTests.cs
More file actions
49 lines (41 loc) · 1.17 KB
/
HttpMethodProviderTests.cs
File metadata and controls
49 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using Shouldly;
using NUnit.Framework;
namespace uhttpsharp.Tests
{
public class HttpMethodProviderTests
{
private static IHttpMethodProvider GetTarget()
{
return new HttpMethodProvider();
}
public static IEnumerable<object> Methods
{
get
{
return Enum.GetNames(typeof(HttpMethods));
}
}
[Test]
[TestCase(HttpMethods.Connect)]
[TestCase(HttpMethods.Delete)]
[TestCase(HttpMethods.Get)]
[TestCase(HttpMethods.Head)]
[TestCase(HttpMethods.Options)]
[TestCase(HttpMethods.Patch)]
[TestCase(HttpMethods.Post)]
[TestCase(HttpMethods.Put)]
[TestCase(HttpMethods.Trace)]
public void Should_Get_Right_Method(HttpMethods method)
{
// Arrange
var methodName = Enum.GetName(typeof(HttpMethods), method);
var target = GetTarget();
// Act
var actual = target.Provide(methodName);
// Assert
actual.ToString().ShouldBe(methodName);
}
}
}