forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckWebTests.cs
More file actions
56 lines (50 loc) · 1.33 KB
/
CheckWebTests.cs
File metadata and controls
56 lines (50 loc) · 1.33 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
50
51
52
53
54
55
56
using NUnit.Framework;
using ServiceStack.Text;
namespace ServiceStack.Common.Tests
{
/// <summary>
/// The Echo interface.
/// </summary>
public interface IEcho
{
/// <summary>
/// Gets or sets the sentence to echo.
/// </summary>
string Sentence { get; set; }
}
/// <summary>
/// The Echo.
/// </summary>
public class Echo : IEcho
{
/// <summary>
/// Gets or sets the sentence.
/// </summary>
public string Sentence { get; set; }
}
[Api("Echoes a sentence")]
[Route("/echoes", "POST", Summary = @"Echoes a sentence.")]
public class Echoes : IReturn<IEcho>
{
/// <summary>
/// Gets or sets the sentence to echo.
/// </summary>
[ApiMember(Name = "Sentence",
DataType = "string",
Description = "The sentence to echo.",
IsRequired = true,
ParameterType = "form")]
public string Sentence { get; set; }
}
[Explicit]
public class CheckWebTests
{
private const string BaseUri = "http://localhost:55799/";
[Test]
public void Can_send_echoes_POST()
{
var client = new JsonServiceClient(BaseUri);
var response = client.Post(new Echoes { Sentence = "Foo" });
}
}
}