RegexExtended in settings (#700)

* Add extra unittest for RegexExtended

* settings
This commit is contained in:
Stef Heyenrath
2021-12-12 15:40:38 +01:00
committed by GitHub
parent 4a434b5dba
commit 6943b90da6
8 changed files with 71 additions and 24 deletions

View File

@@ -1,3 +1,5 @@
using System;
using FluentAssertions;
using NFluent;
using WireMock.Matchers;
using Xunit;
@@ -70,6 +72,32 @@ namespace WireMock.Net.Tests.Matchers
Check.That(result).IsEqualTo(0.0d);
}
[Fact]
public void RegexMatcher_IsMatch_RegexExtended_Guid()
{
// Assign
var matcher = new RegexMatcher(@"\GUIDB", true);
// Act
double result = matcher.IsMatch(Guid.NewGuid().ToString("B"));
// Assert
result.Should().Be(1.0);
}
[Fact]
public void RegexMatcher_IsMatch_Regex_Guid()
{
// Assign
var matcher = new RegexMatcher(@"\GUIDB", true, false, false);
// Act
double result = matcher.IsMatch(Guid.NewGuid().ToString("B"));
// Assert
result.Should().Be(0);
}
[Fact]
public void RegexMatcher_IsMatch_IgnoreCase()
{

View File

@@ -10,7 +10,7 @@ namespace WireMock.Net.Tests.RegularExpressions
/// <summary>
/// Input guid used for testing
/// </summary>
public Guid InputGuid { get; } = Guid.NewGuid();
public Guid InputGuid => Guid.NewGuid();
[Fact]
public void RegexExtended_GuidB_Pattern()