Skip to content

Commit

Permalink
Merge pull request #91 from liviuconcioiu/88
Browse files Browse the repository at this point in the history
  • Loading branch information
totpero authored Dec 4, 2024
2 parents 3606745 + ce70d80 commit 3ad8eda
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions DeviceDetector.NET.Tests/DeviceDetectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,12 @@ public void TestIssue88_Test1()
var dd = DeviceDetector.GetInfoFromUserAgent(userAgent);
dd.Success.Should().BeTrue();
var browserMatch = dd.Match.Client as BrowserMatchResult;
browserMatch.Should().Be("Chrome");
browserMatch.Should().Be("131.0.0.0");
browserMatch.EngineVersion.Should().Be("Blink");

browserMatch.Name.Should().Be("Chrome");
browserMatch.Version.Should().Be("131.0.0.0");
browserMatch.Engine.Should().Be("Blink");
browserMatch.EngineVersion.Should().Be("131.0.0.0");
}

/// <summary>
/// Issue #88
/// </summary>
Expand All @@ -819,9 +820,30 @@ public void TestIssue88_Test2()
var dd = DeviceDetector.GetInfoFromUserAgent(userAgent, clientHints);
dd.Success.Should().BeTrue();
var browserMatch = dd.Match.Client as BrowserMatchResult;
browserMatch.Should().Be("360 Secure Browser");
browserMatch.Should().Be("131.0.0.0");
browserMatch.EngineVersion.Should().Be("Blink");
browserMatch.Name.Should().Be("Chrome");
browserMatch.Version.Should().Be("131.0.0.0");
browserMatch.Engine.Should().Be("Blink");
browserMatch.EngineVersion.Should().Be("131.0.0.0");
}

/// <summary>
/// Issue #88
/// </summary>
[Fact]
public void TestIssue88_Test3()
{
var clientHints = ClientHints.Factory(new Dictionary<string, string>
{
["sec-ch-ua"] = "\"Chromium\";v=\"15\", \"Not.A/Brand\";v=\"8\"",
});

const string userAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.5735.196 Safari/537.36";
var dd = DeviceDetector.GetInfoFromUserAgent(userAgent, clientHints);
dd.Success.Should().BeTrue();
var browserMatch = dd.Match.Client as BrowserMatchResult;
browserMatch.Name.Should().Be("360 Secure Browser");
browserMatch.Version.Should().Be("15");
browserMatch.Engine.Should().Be("Blink");
browserMatch.EngineVersion.Should().Be("114.0.5735.196");
}
}

0 comments on commit 3ad8eda

Please sign in to comment.