Rebel.Hive.Configuration.ProviderMappingGroup.IsMatchForUri C# (CSharp) Method

IsMatchForUri() public method

Determines whether this group matches the specified route URI.
public IsMatchForUri ( Uri uri ) : ProviderUriMatchResult
uri System.Uri The URI.
return ProviderUriMatchResult
        public ProviderUriMatchResult IsMatchForUri(Uri uri)
        {
            Mandate.ParameterNotNull(uri, "uri");
            return IsMatchForUri(FixUriBugs(uri.ToString()));
        }

Same methods

ProviderMappingGroup::IsMatchForUri ( string uri ) : ProviderUriMatchResult

Usage Example

Example #1
0
        public void ProviderMappingGroup_IsMatchForUri(string assertUri, string[] wildcardMatches, bool shouldMatch)
        {
            // Arrange
            var matches = wildcardMatches.Select(x => new WildcardUriMatch(x)).ToList();
            var context = new FakeFrameworkContext();
            var metadata = new ProviderMetadata("test", new Uri("unimportant://"), true, false);
            var readonlySetup = new UninstalledReadonlyProviderSetup(metadata, context, new NoopProviderBootstrapper(), 0);
            var setup = new UninstalledProviderSetup(metadata, context, new NoopProviderBootstrapper(), 0);
            var group = new ProviderMappingGroup("default", matches, Enumerable.Repeat(readonlySetup, 1), Enumerable.Repeat(setup, 1), new FakeFrameworkContext());

            // Assert
            Assert.That(shouldMatch, Is.EqualTo(group.IsMatchForUri(new Uri(assertUri)).Success));
        }