/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Middleware/Rewrite/test/PatternSegments/RuleMatchSegmentTests.cs
33 строки
1018 B
Shreyas Jejurkar
chore : Remove unwanted `using` statement (#39176)
02 янв 2022, 17:39
Не верифицирован
02 янв 2022, 17:39
c85baf8
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Text.RegularExpressions; using Microsoft.AspNetCore.Rewrite.PatternSegments; namespace Microsoft.AspNetCore.Rewrite.Tests.PatternSegments; public class RuleMatchSegmentTests { [Theory] [InlineData(1, "foo")] [InlineData(2, "bar")] [InlineData(3, "baz")] public void RuleMatch_AssertBackreferencesObtainsCorrectValue(int index, string expected) { // Arrange var ruleMatch = CreateTestMatch(); var segment = new RuleMatchSegment(index); // Act var results = segment.Evaluate(null, ruleMatch.BackReferences, null); // Assert Assert.Equal(expected, results); } private static MatchResults CreateTestMatch() { var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)"); return new MatchResults(match.Success, new BackReferenceCollection(match.Groups)); } }