Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        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));
            }
        }