Exemplo n.º 1
0
        public void CanParseUriPathToScope()
        {
            var auth = new AuthHandler(new DictCache <Authorization>());

            Assert.AreEqual("registry:catalog", auth.ParseScope(new Uri("https://myregistry.io/v2/_catalog")));
            Assert.AreEqual("repository:coolimage", auth.ParseScope(new Uri("https://myregistry.io/v2/coolimage/tags/list")));
            Assert.AreEqual("repository:cool/image", auth.ParseScope(new Uri("https://myregistry.io/v2/cool/image/manifests/latest")));
            Assert.AreEqual("repository:super/cool/image", auth.ParseScope(new Uri("https://myregistry.io/v2/super/cool/image/blobs/sha256:digest")));
        }
Exemplo n.º 2
0
        public void CanThrowOnBadUriPath()
        {
            var auth = new AuthHandler(new DictCache <Authorization>());

            auth.ParseScope(new Uri("https://myregistry.io/something/else"));
        }
Exemplo n.º 3
0
        public void CanThrowOnBadUriPath()
        {
            var auth = new AuthHandler(new DictCache <Authorization>(), null, null);

            Assert.Throws <ArgumentException>(() => auth.ParseScope(new Uri("https://myregistry.io/something/else")));
        }