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
40 lines (35 loc) · 1.11 KB
/
Copy pathHttpMethodProviderTests.cs
File metadata and controls
40 lines (35 loc) · 1.11 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
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 => 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
string methodName = Enum.GetName(typeof(HttpMethods), method);
IHttpMethodProvider target = GetTarget();
// Act
HttpMethods actual = target.Provide(methodName);
// Assert
actual.ToString().ShouldBe(methodName);
}
}
}