Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
totpero committed Nov 29, 2024
1 parent 7bc1487 commit 5893901
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions DeviceDetector.NET.Tests/Class/DeviceDetectorFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ namespace DeviceDetectorNET.Tests.Class
{
public class DeviceDetectorFixture
{
public string user_agent { get; set; }
[YamlMember(Alias = "user_agent")]
public string UserAgent { get; set; }

public object os { get; set; }
public ClientDevice client { get; set; }
Expand All @@ -32,7 +33,8 @@ public class ClientDevice
public string short_name { get; set; }
public string version { get; set; }
public string engine { get; set; }
public string engine_version { get; set; }
[YamlMember(Alias = "engine_version")]
public string EngineVersion { get; set; }
}

public class Device
Expand Down
6 changes: 3 additions & 3 deletions DeviceDetector.NET.Tests/DeviceDetectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public void TestParse(string fileNme)
{
var clientHints = expected.headers.Any() ? ClientHints.Factory(expected.headers.ToDictionary()) : null;
var dd = DeviceDetector.GetInfoFromUserAgent(expected.user_agent, clientHints);
var dd = DeviceDetector.GetInfoFromUserAgent(expected.UserAgent, clientHints);
dd.Success.Should().BeTrue();
dd.Match.OsFamily.Should().BeOneOf(expected.os_family, DeviceDetector.UNKNOWN_FULL);
Expand Down Expand Up @@ -306,7 +306,7 @@ public void TestParseClient(string fileNme)

Parallel.ForEach(fixtureData, expected =>
{
var ua = expected.user_agent;
var ua = expected.UserAgent;
var clientHints = expected.headers.Any() ? ClientHints.Factory(expected.headers.ToDictionary()) : null;
var uaInfo = DeviceDetector.GetInfoFromUserAgent(ua, clientHints);
Expand All @@ -328,7 +328,7 @@ public void TestParseDevice(string fileNme)

Parallel.ForEach(fixtureData, expected =>
{
var ua = expected.user_agent;
var ua = expected.UserAgent;
var clientHints = expected.headers.Any() ? ClientHints.Factory(expected.headers.ToDictionary()) : null;
var uaInfo = DeviceDetector.GetInfoFromUserAgent(ua, clientHints);
Expand Down

0 comments on commit 5893901

Please sign in to comment.