Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #9 Fix warnings #12

Merged
merged 26 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
HttpMethod should be String not type HttpMethod
  • Loading branch information
miquelbeltran committed Jul 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a83bccf2138bf55223003d1ab2983f94421aff4b
2 changes: 1 addition & 1 deletion src/Raygun.NetCore.Blazor/Models/RequestDetails.cs
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ internal record RequestDetails
/// The HTTP method used to request the URL (GET, POST, PUT, etc).
/// </summary>
[JsonInclude]
public HttpMethod HttpMethod { get; set; }
public string HttpMethod { get; set; }

/// <summary>
/// The IP address of the client that initiated the request.
6 changes: 3 additions & 3 deletions src/Raygun.NetCore.Tests.Blazor/SerializationTests.cs
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ public class SerializationTests

#region Private Members

private const string apiDocsPayload = "{\r\n \"occurredOn\": \"2015-09-08T01:55:28Z\",\r\n \"details\": {\r\n \"machineName\": \"ServerMachine1\",\r\n \"groupingKey\": \"ErrorGroup\",\r\n \"version\": \"1.0.0.1\",\r\n \"client\": {\r\n \"name\": \"Example Raygun Client\",\r\n \"version\": \"0.0.0.1\",\r\n \"clientUrl\": \"/documentation/integrations/api\"\r\n },\r\n \"error\": {\r\n \"innerError\": {},\r\n \"data\": {\r\n \"example\": 5\r\n },\r\n \"className\": \"ErrorClass\",\r\n \"message\": \"An error occurred\",\r\n \"stackTrace\": [\r\n {\r\n \"lineNumber\": 55,\r\n \"className\": \"BrokenService\",\r\n \"columnNumber\": 23,\r\n \"fileName\": \"BrokenService.cs\",\r\n \"methodName\": \"BreakEverything()\"\r\n }\r\n ]\r\n },\r\n \"environment\": {\r\n \"processorCount\": 4,\r\n \"osVersion\": \"Windows 10\",\r\n \"windowBoundsWidth\": 2560,\r\n \"windowBoundsHeight\": 1440,\r\n \"browser-Width\": 2560,\r\n \"browser-Height\": 1440,\r\n \"screen-Width\": 2560,\r\n \"screen-Height\": 1440,\r\n \"resolutionScale\": 1,\r\n \"color-Depth\": 24,\r\n \"currentOrientation\": \"Landscape\",\r\n \"cpu\": \"Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz\",\r\n \"packageVersion\": \"package version\",\r\n \"architecture\": \"ARMv7-A\",\r\n \"deviceManufacturer\": \"Nokia\",\r\n \"model\": \"Lumia 920\",\r\n \"totalPhysicalMemory\": 1024,\r\n \"availablePhysicalMemory\": 500,\r\n \"totalVirtualMemory\": 500,\r\n \"availableVirtualMemory\": 500,\r\n \"diskSpaceFree\": [\r\n 50000.52,\r\n 2000.104\r\n ],\r\n \"deviceName\": \"Nexus 7\",\r\n \"locale\": \"en-nz\",\r\n \"utcOffset\": -12,\r\n \"browser\": \"Mozilla\",\r\n \"browserName\": \"Netscape\",\r\n \"browser-Version\": \"5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36\",\r\n \"platform\": \"Win32\"\r\n },\r\n \"tags\": [\r\n \"tag1\",\r\n \"tag 2\",\r\n \"tag-3\"\r\n ],\r\n \"userCustomData\": {\r\n \"domain\": \"WORKPLACE\",\r\n \"area\": \"51\"\r\n },\r\n \"request\": {\r\n \"hostName\": \"https://raygun.io\",\r\n \"url\": \"/documentation/integrations/api\",\r\n \"httpMethod\": \"POST\",\r\n \"iPAddress\": \"127.0.0.1\",\r\n \"queryString\": {\r\n \"q\": \"searchParams\"\r\n },\r\n \"form\": {\r\n \"firstName\": \"Example\",\r\n \"lastName\": \"Person\",\r\n \"newsletter\": true\r\n },\r\n \"headers\": {\r\n \"Referer\": \"www.google.com\",\r\n \"Host\": \"raygun.io\"\r\n },\r\n \"rawData\": \"{\\\"Test\\\": 5}\"\r\n },\r\n \"response\": {\r\n \"statusCode\": 500\r\n },\r\n \"user\": {\r\n \"identifier\": \"123456789\",\r\n \"isAnonymous\": false,\r\n \"email\": \"[email protected]\",\r\n \"fullName\": \"Test User\",\r\n \"firstName\": \"Test\",\r\n \"uuid\": \"783491e1-d4a9-46bc-9fde-9b1dd9ef6c6e\"\r\n },\r\n \"breadcrumbs\": [\r\n {\r\n \"timeStamp\": 1504799959639,\r\n \"level\": \"info\",\r\n \"type\": \"navigation\",\r\n \"category\": \"checkout\",\r\n \"message\": \"User navigated to the shopping cart\",\r\n \"className\": \"ShoppingCart\",\r\n \"methodName\": \"ViewBasket\",\r\n \"lineNumber\": 156,\r\n \"customData\": {\r\n \"from\": \"/category/product/123\",\r\n \"to\": \"/cart/view\"\r\n }\r\n }\r\n ]\r\n }\r\n}";
private JsonSerializerOptions jsonSerializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, };
private const string ApiDocsPayload = "{\r\n \"occurredOn\": \"2015-09-08T01:55:28Z\",\r\n \"details\": {\r\n \"machineName\": \"ServerMachine1\",\r\n \"groupingKey\": \"ErrorGroup\",\r\n \"version\": \"1.0.0.1\",\r\n \"client\": {\r\n \"name\": \"Example Raygun Client\",\r\n \"version\": \"0.0.0.1\",\r\n \"clientUrl\": \"/documentation/integrations/api\"\r\n },\r\n \"error\": {\r\n \"innerError\": {},\r\n \"data\": {\r\n \"example\": 5\r\n },\r\n \"className\": \"ErrorClass\",\r\n \"message\": \"An error occurred\",\r\n \"stackTrace\": [\r\n {\r\n \"lineNumber\": 55,\r\n \"className\": \"BrokenService\",\r\n \"columnNumber\": 23,\r\n \"fileName\": \"BrokenService.cs\",\r\n \"methodName\": \"BreakEverything()\"\r\n }\r\n ]\r\n },\r\n \"environment\": {\r\n \"processorCount\": 4,\r\n \"osVersion\": \"Windows 10\",\r\n \"windowBoundsWidth\": 2560,\r\n \"windowBoundsHeight\": 1440,\r\n \"browser-Width\": 2560,\r\n \"browser-Height\": 1440,\r\n \"screen-Width\": 2560,\r\n \"screen-Height\": 1440,\r\n \"resolutionScale\": 1,\r\n \"color-Depth\": 24,\r\n \"currentOrientation\": \"Landscape\",\r\n \"cpu\": \"Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz\",\r\n \"packageVersion\": \"package version\",\r\n \"architecture\": \"ARMv7-A\",\r\n \"deviceManufacturer\": \"Nokia\",\r\n \"model\": \"Lumia 920\",\r\n \"totalPhysicalMemory\": 1024,\r\n \"availablePhysicalMemory\": 500,\r\n \"totalVirtualMemory\": 500,\r\n \"availableVirtualMemory\": 500,\r\n \"diskSpaceFree\": [\r\n 50000.52,\r\n 2000.104\r\n ],\r\n \"deviceName\": \"Nexus 7\",\r\n \"locale\": \"en-nz\",\r\n \"utcOffset\": -12,\r\n \"browser\": \"Mozilla\",\r\n \"browserName\": \"Netscape\",\r\n \"browser-Version\": \"5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36\",\r\n \"platform\": \"Win32\"\r\n },\r\n \"tags\": [\r\n \"tag1\",\r\n \"tag 2\",\r\n \"tag-3\"\r\n ],\r\n \"userCustomData\": {\r\n \"domain\": \"WORKPLACE\",\r\n \"area\": \"51\"\r\n },\r\n \"request\": {\r\n \"hostName\": \"https://raygun.io\",\r\n \"url\": \"/documentation/integrations/api\",\r\n \"httpMethod\": \"POST\",\r\n \"iPAddress\": \"127.0.0.1\",\r\n \"queryString\": {\r\n \"q\": \"searchParams\"\r\n },\r\n \"form\": {\r\n \"firstName\": \"Example\",\r\n \"lastName\": \"Person\",\r\n \"newsletter\": true\r\n },\r\n \"headers\": {\r\n \"Referer\": \"www.google.com\",\r\n \"Host\": \"raygun.io\"\r\n },\r\n \"rawData\": \"{\\\"Test\\\": 5}\"\r\n },\r\n \"response\": {\r\n \"statusCode\": 500\r\n },\r\n \"user\": {\r\n \"identifier\": \"123456789\",\r\n \"isAnonymous\": false,\r\n \"email\": \"[email protected]\",\r\n \"fullName\": \"Test User\",\r\n \"firstName\": \"Test\",\r\n \"uuid\": \"783491e1-d4a9-46bc-9fde-9b1dd9ef6c6e\"\r\n },\r\n \"breadcrumbs\": [\r\n {\r\n \"timeStamp\": 1504799959639,\r\n \"level\": \"info\",\r\n \"type\": \"navigation\",\r\n \"category\": \"checkout\",\r\n \"message\": \"User navigated to the shopping cart\",\r\n \"className\": \"ShoppingCart\",\r\n \"methodName\": \"ViewBasket\",\r\n \"lineNumber\": 156,\r\n \"customData\": {\r\n \"from\": \"/category/product/123\",\r\n \"to\": \"/cart/view\"\r\n }\r\n }\r\n ]\r\n }\r\n}";
private readonly JsonSerializerOptions _jsonSerializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, };

#endregion

@@ -29,7 +29,7 @@ public class SerializationTests
[TestMethod]
public void ApiDocsPayload_ShouldDeserialize()
{
var result = JsonSerializer.Deserialize<RaygunRequest>(apiDocsPayload, jsonSerializerOptions);
var result = JsonSerializer.Deserialize<RaygunRequest>(ApiDocsPayload, _jsonSerializerOptions);
result.Should().NotBeNull();
result.OccurredOn.Should().Be(new DateTime(2015, 09, 08, 01, 55, 28, DateTimeKind.Utc));
result.Details.Should().NotBeNull();
Loading