Skip to content

Commit

Permalink
feat(test): added basic tests for request class
Browse files Browse the repository at this point in the history
More tests will be included soon
  • Loading branch information
sikelio committed Aug 2, 2024
1 parent 0758af6 commit 0791b1c
Show file tree
Hide file tree
Showing 9 changed files with 529 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "Web\Web.csproj", "{3
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Test", "System.Test\System.Test.csproj", "{1501A81F-3308-4471-BCDF-113AC9BF13EA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web.Test", "Web.Test\Web.Test.csproj", "{69DD9B31-30B7-43FC-A43B-462FDB56A4FF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,6 +29,10 @@ Global
{1501A81F-3308-4471-BCDF-113AC9BF13EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1501A81F-3308-4471-BCDF-113AC9BF13EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1501A81F-3308-4471-BCDF-113AC9BF13EA}.Release|Any CPU.Build.0 = Release|Any CPU
{69DD9B31-30B7-43FC-A43B-462FDB56A4FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69DD9B31-30B7-43FC-A43B-462FDB56A4FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69DD9B31-30B7-43FC-A43B-462FDB56A4FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69DD9B31-30B7-43FC-A43B-462FDB56A4FF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
70 changes: 70 additions & 0 deletions Web.Test/Models/HttpBinDeleteResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
{
public class HttpBinDeleteResponse
{
[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; }
}
}
58 changes: 58 additions & 0 deletions Web.Test/Models/HttpBinGetResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
{
public class HttpBinGetResponse
{
[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; }
}
}
70 changes: 70 additions & 0 deletions Web.Test/Models/HttpBinPatchResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
{
public class HttpBinPatchResponse
{
[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; }
}
}
61 changes: 61 additions & 0 deletions Web.Test/Models/HttpBinPostFileResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
{
public class HttpBinPostFileResponse
{
[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; }
}
}
73 changes: 73 additions & 0 deletions Web.Test/Models/HttpBinPostResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System.Text.Json.Serialization;

namespace Web.Test.Models
{
public class 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 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 0791b1c

Please sign in to comment.