Skip to content

Commit

Permalink
feat: refractored web tests models
Browse files Browse the repository at this point in the history
  • Loading branch information
sikelio committed Aug 5, 2024
1 parent b2906ff commit 9bbc479
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 367 deletions.
68 changes: 2 additions & 66 deletions Web.Test/Models/HttpBinDeleteResponse.cs
Original file line number Diff line number Diff line change
@@ -1,70 +1,6 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
namespace Web.Test.Models
{
public class HttpBinDeleteResponse
public class HttpBinDeleteResponse : HttpBinResponseBase
{
[JsonPropertyName("args")]
public Dictionary<string, string> Args { get; set; }

[JsonPropertyName("data")]
public string Data { get; set; }

[JsonPropertyName("files")]
public Dictionary<string, string> Files { get; set; }

[JsonPropertyName("form")]
public Dictionary<string, string> Form { get; set; }

[JsonPropertyName("headers")]
public HttpBinDeleteResponseHeaders Headers { get; set; }

[JsonPropertyName("json")]
public object Json { get; set; }

[JsonPropertyName("origin")]
public string Origin { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}

public class HttpBinDeleteResponseHeaders
{
[JsonPropertyName("Accept")]
public string Accept { get; set; }

[JsonPropertyName("Accept-Encoding")]
public string AcceptEncoding { get; set; }

[JsonPropertyName("Accept-Language")]
public string AcceptLanguage { get; set; }

[JsonPropertyName("Host")]
public string Host { get; set; }

[JsonPropertyName("Origin")]
public string Origin { get; set; }

[JsonPropertyName("Priority")]
public string Priority { get; set; }

[JsonPropertyName("Referer")]
public string Referer { get; set; }

[JsonPropertyName("Sec-Fetch-Dest")]
public string SecFetchDest { get; set; }

[JsonPropertyName("Sec-Fetch-Mode")]
public string SecFetchMode { get; set; }

[JsonPropertyName("Sec-Fetch-Site")]
public string SecFetchSite { get; set; }

[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }

[JsonPropertyName("X-Amzn-Trace-Id")]
public string AmazonTraceId { get; set; }
}
}
56 changes: 2 additions & 54 deletions Web.Test/Models/HttpBinGetResponse.cs
Original file line number Diff line number Diff line change
@@ -1,58 +1,6 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
namespace Web.Test.Models
{
public class HttpBinGetResponse
public class HttpBinGetResponse : HttpBinResponseBase
{
[JsonPropertyName("args")]
public Dictionary<string, string> Args { get; set; }

[JsonPropertyName("headers")]
public HttpBinGetResponseHeaders Headers { get; set; }

[JsonPropertyName("origin")]
public string Origin { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}

public class HttpBinGetResponseHeaders
{
[JsonPropertyName("Accept")]
public string Accept { get; set; }

[JsonPropertyName("Accept-Encoding")]
public string AcceptEncoding { get; set; }

[JsonPropertyName("Accept-Language")]
public string AcceptLanguage { get; set; }

[JsonPropertyName("Host")]
public string Host { get; set; }

[JsonPropertyName("Priority")]
public string Priority { get; set; }

[JsonPropertyName("Sec-Fetch-Dest")]
public string SecFetchDest { get; set; }

[JsonPropertyName("Sec-Fetch-Mode")]
public string SecFecthMode { get; set; }

[JsonPropertyName("Sec-Fetch-Site")]
public string SecFetchSite { get; set; }

[JsonPropertyName("Sec-Fetch-User")]
public string SecFetchUser { get; set; }

[JsonPropertyName("Upgrade-Insecure-Requests")]
public string UpgradeInsecureRequests { get; set; }

[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }

[JsonPropertyName("X-Amzn-Trace-Id")]
public string AmazonTraceId { get; set; }
}
}
68 changes: 2 additions & 66 deletions Web.Test/Models/HttpBinPatchResponse.cs
Original file line number Diff line number Diff line change
@@ -1,70 +1,6 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
namespace Web.Test.Models
{
public class HttpBinPatchResponse
public class HttpBinPatchResponse : HttpBinPostResponse
{
[JsonPropertyName("args")]
public Dictionary<string, string> Args { get; set; }

[JsonPropertyName("data")]
public string Data { get; set; }

[JsonPropertyName("files")]
public Dictionary<string, string> Files { get; set; }

[JsonPropertyName("form")]
public Dictionary<string, string> Form { get; set; }

[JsonPropertyName("headers")]
public HttpBinPatchResponseHeaders Headers { get; set; }

[JsonPropertyName("json")]
public object Json { get; set; }

[JsonPropertyName("origin")]
public string Origin { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}

public class HttpBinPatchResponseHeaders
{
[JsonPropertyName("Accept")]
public string Accept { get; set; }

[JsonPropertyName("Accept-Encoding")]
public string AcceptEncoding { get; set; }

[JsonPropertyName("Accept-Language")]
public string AcceptLanguage { get; set; }

[JsonPropertyName("Host")]
public string Host { get; set; }

[JsonPropertyName("Origin")]
public string Origin { get; set; }

[JsonPropertyName("Priority")]
public string Priority { get; set; }

[JsonPropertyName("Referer")]
public string Referer { get; set; }

[JsonPropertyName("Sec-Fetch-Dest")]
public string SecFetchDest { get; set; }

[JsonPropertyName("Sec-Fetch-Mode")]
public string SecFetchMode { get; set; }

[JsonPropertyName("Sec-Fetch-Site")]
public string SecFetchSite { get; set; }

[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }

[JsonPropertyName("X-Amzn-Trace-Id")]
public string AmazonTraceId { get; set; }
}
}
59 changes: 2 additions & 57 deletions Web.Test/Models/HttpBinPostFileResponse.cs
Original file line number Diff line number Diff line change
@@ -1,61 +1,6 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
namespace Web.Test.Models
{
public class HttpBinPostFileResponse
public class HttpBinPostFileResponse : HttpBinPostResponse
{
[JsonPropertyName("args")]
public Dictionary<string, string> Args { get; set; }

[JsonPropertyName("data")]
public string Data { get; set; }

[JsonPropertyName("files")]
public Dictionary<string, string> Files { get; set; }

[JsonPropertyName("form")]
public Dictionary<string, string> Form { get; set; }

[JsonPropertyName("headers")]
public HttpBinPostFileResponseHeaders Headers { get; set; }

[JsonPropertyName("json")]
public object Json { get; set; }

[JsonPropertyName("origin")]
public string Origin { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}

public class HttpBinPostFileResponseHeaders
{
[JsonPropertyName("Accept")]
public string Accept { get; set; }

[JsonPropertyName("Accept-Encoding")]
public string AcceptEncoding { get; set; }

[JsonPropertyName("Cache-Control")]
public string CacheControl { get; set; }

[JsonPropertyName("Content-Length")]
public string ContentLength { get; set; }

[JsonPropertyName("Content-Type")]
public string ContentType { get; set; }

[JsonPropertyName("Host")]
public string Host { get; set; }

[JsonPropertyName("Postman-Token")]
public string PostmanToken { get; set; }

[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }

[JsonPropertyName("X-Amzn-Trace-Id")]
public string AmazonTraceId { get; set; }
}
}
56 changes: 1 addition & 55 deletions Web.Test/Models/HttpBinPostResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace Web.Test.Models
{
public class HttpBinPostResponse
public class HttpBinPostResponse : HttpBinResponseBase
{
[JsonPropertyName("args")]
public Dictionary<string, string> Args { get; set; }

[JsonPropertyName("data")]
public string Data { get; set; }

Check warning on line 8 in Web.Test/Models/HttpBinPostResponse.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable property 'Data' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

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

[JsonPropertyName("headers")]
public HttpBinPostResponseHeaders Headers { get; set; }

[JsonPropertyName("json")]
public object Json { get; set; }

[JsonPropertyName("origin")]
public string Origin { get; set; }

[JsonPropertyName("url")]
public string Url { get; set; }
}

public class HttpBinPostResponseHeaders
{
[JsonPropertyName("Accept")]
public string Accept { get; set; }

[JsonPropertyName("Accept-Encoding")]
public string AcceptEncoding { get; set; }

[JsonPropertyName("Accept-Language")]
public string AcceptLanguage { get; set; }

[JsonPropertyName("Content-Length")]
public string ContentLength { get; set; }

[JsonPropertyName("Host")]
public string Host { get; set; }

[JsonPropertyName("Origin")]
public string Origin { get; set; }

[JsonPropertyName("Priority")]
public string Priority { get; set; }

[JsonPropertyName("Referer")]
public string Referer { get; set; }

[JsonPropertyName("Sec-Fetch-Dest")]
public string SecFetchDest { get; set; }

[JsonPropertyName("Sec-Fetch-Mode")]
public string SecFetchMode { get; set; }

[JsonPropertyName("Sec-Fetch-Site")]
public string SecFetchSite { get; set; }

[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }

[JsonPropertyName("X-Amzn-Trace-Id")]
public string AmazonTraceId { get; set; }
}
}
Loading

0 comments on commit 9bbc479

Please sign in to comment.