void LocalizeUri(Configurations configurations, Uri inputUri, Uri expectedOutputUri, Type expectedExceptionType) { if (configurations != null) { ServiceLocator.AddOrReplaceServices(new ServiceDescriptor(typeof(Configurations), configurations)); } var resourceScope = ServiceLocator.Get <IResourceScope>(); if (expectedExceptionType != null) { Assert.Throws(expectedExceptionType, () => { resourceScope.Localize(inputUri); }); } else { Assert.StrictEqual(expectedOutputUri, resourceScope.Localize(inputUri)); } }
void IdentifyStartUri(Configurations configurations, Uri inputUri, bool expectedIdentificationResult, Type expectedExceptionType) { if (configurations != null) { ServiceLocator.AddOrReplaceServices(new ServiceDescriptor(typeof(Configurations), configurations)); } var resourceScope = ServiceLocator.Get <IResourceScope>(); if (expectedExceptionType != null) { Assert.Throws(expectedExceptionType, () => { resourceScope.IsStartUri(inputUri); }); } else { Assert.Equal(expectedIdentificationResult, resourceScope.IsStartUri(inputUri)); } }