Skip to content

Commit 9bbc479

Browse files
committed
feat: refractored web tests models
1 parent b2906ff commit 9bbc479

File tree

7 files changed

+51
-367
lines changed

7 files changed

+51
-367
lines changed
Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,6 @@
1-
using System.Text.Json.Serialization;
2-
3-
namespace Web.Test.Models
1+
namespace Web.Test.Models
42
{
5-
public class HttpBinDeleteResponse
3+
public class HttpBinDeleteResponse : HttpBinResponseBase
64
{
7-
[JsonPropertyName("args")]
8-
public Dictionary<string, string> Args { get; set; }
9-
10-
[JsonPropertyName("data")]
11-
public string Data { get; set; }
12-
13-
[JsonPropertyName("files")]
14-
public Dictionary<string, string> Files { get; set; }
15-
16-
[JsonPropertyName("form")]
17-
public Dictionary<string, string> Form { get; set; }
18-
19-
[JsonPropertyName("headers")]
20-
public HttpBinDeleteResponseHeaders Headers { get; set; }
21-
22-
[JsonPropertyName("json")]
23-
public object Json { get; set; }
24-
25-
[JsonPropertyName("origin")]
26-
public string Origin { get; set; }
27-
28-
[JsonPropertyName("url")]
29-
public string Url { get; set; }
30-
}
31-
32-
public class HttpBinDeleteResponseHeaders
33-
{
34-
[JsonPropertyName("Accept")]
35-
public string Accept { get; set; }
36-
37-
[JsonPropertyName("Accept-Encoding")]
38-
public string AcceptEncoding { get; set; }
39-
40-
[JsonPropertyName("Accept-Language")]
41-
public string AcceptLanguage { get; set; }
42-
43-
[JsonPropertyName("Host")]
44-
public string Host { get; set; }
45-
46-
[JsonPropertyName("Origin")]
47-
public string Origin { get; set; }
48-
49-
[JsonPropertyName("Priority")]
50-
public string Priority { get; set; }
51-
52-
[JsonPropertyName("Referer")]
53-
public string Referer { get; set; }
54-
55-
[JsonPropertyName("Sec-Fetch-Dest")]
56-
public string SecFetchDest { get; set; }
57-
58-
[JsonPropertyName("Sec-Fetch-Mode")]
59-
public string SecFetchMode { get; set; }
60-
61-
[JsonPropertyName("Sec-Fetch-Site")]
62-
public string SecFetchSite { get; set; }
63-
64-
[JsonPropertyName("User-Agent")]
65-
public string UserAgent { get; set; }
66-
67-
[JsonPropertyName("X-Amzn-Trace-Id")]
68-
public string AmazonTraceId { get; set; }
695
}
706
}

Web.Test/Models/HttpBinGetResponse.cs

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,6 @@
1-
using System.Text.Json.Serialization;
2-
3-
namespace Web.Test.Models
1+
namespace Web.Test.Models
42
{
5-
public class HttpBinGetResponse
3+
public class HttpBinGetResponse : HttpBinResponseBase
64
{
7-
[JsonPropertyName("args")]
8-
public Dictionary<string, string> Args { get; set; }
9-
10-
[JsonPropertyName("headers")]
11-
public HttpBinGetResponseHeaders Headers { get; set; }
12-
13-
[JsonPropertyName("origin")]
14-
public string Origin { get; set; }
15-
16-
[JsonPropertyName("url")]
17-
public string Url { get; set; }
18-
}
19-
20-
public class HttpBinGetResponseHeaders
21-
{
22-
[JsonPropertyName("Accept")]
23-
public string Accept { get; set; }
24-
25-
[JsonPropertyName("Accept-Encoding")]
26-
public string AcceptEncoding { get; set; }
27-
28-
[JsonPropertyName("Accept-Language")]
29-
public string AcceptLanguage { get; set; }
30-
31-
[JsonPropertyName("Host")]
32-
public string Host { get; set; }
33-
34-
[JsonPropertyName("Priority")]
35-
public string Priority { get; set; }
36-
37-
[JsonPropertyName("Sec-Fetch-Dest")]
38-
public string SecFetchDest { get; set; }
39-
40-
[JsonPropertyName("Sec-Fetch-Mode")]
41-
public string SecFecthMode { get; set; }
42-
43-
[JsonPropertyName("Sec-Fetch-Site")]
44-
public string SecFetchSite { get; set; }
45-
46-
[JsonPropertyName("Sec-Fetch-User")]
47-
public string SecFetchUser { get; set; }
48-
49-
[JsonPropertyName("Upgrade-Insecure-Requests")]
50-
public string UpgradeInsecureRequests { get; set; }
51-
52-
[JsonPropertyName("User-Agent")]
53-
public string UserAgent { get; set; }
54-
55-
[JsonPropertyName("X-Amzn-Trace-Id")]
56-
public string AmazonTraceId { get; set; }
575
}
586
}
Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,6 @@
1-
using System.Text.Json.Serialization;
2-
3-
namespace Web.Test.Models
1+
namespace Web.Test.Models
42
{
5-
public class HttpBinPatchResponse
3+
public class HttpBinPatchResponse : HttpBinPostResponse
64
{
7-
[JsonPropertyName("args")]
8-
public Dictionary<string, string> Args { get; set; }
9-
10-
[JsonPropertyName("data")]
11-
public string Data { get; set; }
12-
13-
[JsonPropertyName("files")]
14-
public Dictionary<string, string> Files { get; set; }
15-
16-
[JsonPropertyName("form")]
17-
public Dictionary<string, string> Form { get; set; }
18-
19-
[JsonPropertyName("headers")]
20-
public HttpBinPatchResponseHeaders Headers { get; set; }
21-
22-
[JsonPropertyName("json")]
23-
public object Json { get; set; }
24-
25-
[JsonPropertyName("origin")]
26-
public string Origin { get; set; }
27-
28-
[JsonPropertyName("url")]
29-
public string Url { get; set; }
30-
}
31-
32-
public class HttpBinPatchResponseHeaders
33-
{
34-
[JsonPropertyName("Accept")]
35-
public string Accept { get; set; }
36-
37-
[JsonPropertyName("Accept-Encoding")]
38-
public string AcceptEncoding { get; set; }
39-
40-
[JsonPropertyName("Accept-Language")]
41-
public string AcceptLanguage { get; set; }
42-
43-
[JsonPropertyName("Host")]
44-
public string Host { get; set; }
45-
46-
[JsonPropertyName("Origin")]
47-
public string Origin { get; set; }
48-
49-
[JsonPropertyName("Priority")]
50-
public string Priority { get; set; }
51-
52-
[JsonPropertyName("Referer")]
53-
public string Referer { get; set; }
54-
55-
[JsonPropertyName("Sec-Fetch-Dest")]
56-
public string SecFetchDest { get; set; }
57-
58-
[JsonPropertyName("Sec-Fetch-Mode")]
59-
public string SecFetchMode { get; set; }
60-
61-
[JsonPropertyName("Sec-Fetch-Site")]
62-
public string SecFetchSite { get; set; }
63-
64-
[JsonPropertyName("User-Agent")]
65-
public string UserAgent { get; set; }
66-
67-
[JsonPropertyName("X-Amzn-Trace-Id")]
68-
public string AmazonTraceId { get; set; }
695
}
706
}
Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,6 @@
1-
using System.Text.Json.Serialization;
2-
3-
namespace Web.Test.Models
1+
namespace Web.Test.Models
42
{
5-
public class HttpBinPostFileResponse
3+
public class HttpBinPostFileResponse : HttpBinPostResponse
64
{
7-
[JsonPropertyName("args")]
8-
public Dictionary<string, string> Args { get; set; }
9-
10-
[JsonPropertyName("data")]
11-
public string Data { get; set; }
12-
13-
[JsonPropertyName("files")]
14-
public Dictionary<string, string> Files { get; set; }
15-
16-
[JsonPropertyName("form")]
17-
public Dictionary<string, string> Form { get; set; }
18-
19-
[JsonPropertyName("headers")]
20-
public HttpBinPostFileResponseHeaders Headers { get; set; }
21-
22-
[JsonPropertyName("json")]
23-
public object Json { get; set; }
24-
25-
[JsonPropertyName("origin")]
26-
public string Origin { get; set; }
27-
28-
[JsonPropertyName("url")]
29-
public string Url { get; set; }
30-
}
31-
32-
public class HttpBinPostFileResponseHeaders
33-
{
34-
[JsonPropertyName("Accept")]
35-
public string Accept { get; set; }
36-
37-
[JsonPropertyName("Accept-Encoding")]
38-
public string AcceptEncoding { get; set; }
39-
40-
[JsonPropertyName("Cache-Control")]
41-
public string CacheControl { get; set; }
42-
43-
[JsonPropertyName("Content-Length")]
44-
public string ContentLength { get; set; }
45-
46-
[JsonPropertyName("Content-Type")]
47-
public string ContentType { get; set; }
48-
49-
[JsonPropertyName("Host")]
50-
public string Host { get; set; }
51-
52-
[JsonPropertyName("Postman-Token")]
53-
public string PostmanToken { get; set; }
54-
55-
[JsonPropertyName("User-Agent")]
56-
public string UserAgent { get; set; }
57-
58-
[JsonPropertyName("X-Amzn-Trace-Id")]
59-
public string AmazonTraceId { get; set; }
605
}
616
}

Web.Test/Models/HttpBinPostResponse.cs

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
namespace Web.Test.Models
44
{
5-
public class HttpBinPostResponse
5+
public class HttpBinPostResponse : HttpBinResponseBase
66
{
7-
[JsonPropertyName("args")]
8-
public Dictionary<string, string> Args { get; set; }
9-
107
[JsonPropertyName("data")]
118
public string Data { get; set; }
129

@@ -16,58 +13,7 @@ public class HttpBinPostResponse
1613
[JsonPropertyName("form")]
1714
public Dictionary<string, string> Form { get; set; }
1815

19-
[JsonPropertyName("headers")]
20-
public HttpBinPostResponseHeaders Headers { get; set; }
21-
2216
[JsonPropertyName("json")]
2317
public object Json { get; set; }
24-
25-
[JsonPropertyName("origin")]
26-
public string Origin { get; set; }
27-
28-
[JsonPropertyName("url")]
29-
public string Url { get; set; }
30-
}
31-
32-
public class HttpBinPostResponseHeaders
33-
{
34-
[JsonPropertyName("Accept")]
35-
public string Accept { get; set; }
36-
37-
[JsonPropertyName("Accept-Encoding")]
38-
public string AcceptEncoding { get; set; }
39-
40-
[JsonPropertyName("Accept-Language")]
41-
public string AcceptLanguage { get; set; }
42-
43-
[JsonPropertyName("Content-Length")]
44-
public string ContentLength { get; set; }
45-
46-
[JsonPropertyName("Host")]
47-
public string Host { get; set; }
48-
49-
[JsonPropertyName("Origin")]
50-
public string Origin { get; set; }
51-
52-
[JsonPropertyName("Priority")]
53-
public string Priority { get; set; }
54-
55-
[JsonPropertyName("Referer")]
56-
public string Referer { get; set; }
57-
58-
[JsonPropertyName("Sec-Fetch-Dest")]
59-
public string SecFetchDest { get; set; }
60-
61-
[JsonPropertyName("Sec-Fetch-Mode")]
62-
public string SecFetchMode { get; set; }
63-
64-
[JsonPropertyName("Sec-Fetch-Site")]
65-
public string SecFetchSite { get; set; }
66-
67-
[JsonPropertyName("User-Agent")]
68-
public string UserAgent { get; set; }
69-
70-
[JsonPropertyName("X-Amzn-Trace-Id")]
71-
public string AmazonTraceId { get; set; }
7218
}
7319
}

0 commit comments

Comments
 (0)