forked from Code-Sharp/uHttpSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHttpMethodProviderTests.cs
More file actions
36 lines (31 loc) · 1.1 KB
/
HttpMethodProviderTests.cs
File metadata and controls
36 lines (31 loc) · 1.1 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
using System;
using System.Collections.Generic;
using NUnit.Framework;
using uhttpsharp;
namespace uHttpSharp.Test {
public class HttpMethodProviderTests {
public static IEnumerable<object> Methods => Enum.GetNames(typeof(HttpMethods));
private static IHttpMethodProvider GetTarget() {
return new HttpMethodProvider();
}
[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
Assert.AreEqual(methodName, actual.ToString());
}
}
}