Пример #1
0
        public void TestIsSatisfiedFalse()
        {
            ResourceContext context = new ResourceContext();
            BearerProcessor processor = new BearerProcessor(new Mock<IServiceFactory>().Object);

            Assert.IsFalse(processor.IsSatisfiedBy(context));
        }
        public void TestIsSatisfiedFalse()
        {
            ResourceContext context   = new ResourceContext();
            BearerProcessor processor = new BearerProcessor(new Mock <IServiceFactory>().Object);

            Assert.IsFalse(processor.IsSatisfiedBy(context));
        }
Пример #3
0
 public void TestIsSatisfiedFalseWrongAuthorizaitonHeader()
 {
     ResourceContext context = new ResourceContext();
     context.Headers = new NameValueCollection();
     context.Headers["Authorization"] = "MAC token=\"something\",...";
     BearerProcessor processor = new BearerProcessor(new Mock<IServiceFactory>().Object);
     
     Assert.IsFalse(processor.IsSatisfiedBy(context));
 }
        public void TestIsSatisfiedFalseWrongAuthorizaitonHeader()
        {
            ResourceContext context = new ResourceContext();

            context.Headers = new NameValueCollection();
            context.Headers["Authorization"] = "MAC token=\"something\",...";
            BearerProcessor processor = new BearerProcessor(new Mock <IServiceFactory>().Object);

            Assert.IsFalse(processor.IsSatisfiedBy(context));
        }
Пример #5
0
        public void TestIsSatisfiedByHeaderTrue()
        {
            ResourceContext context = new ResourceContext();
            context.Headers = new NameValueCollection();
            context.Headers["Authorization"] = "Bearer 123456";

            BearerProcessor processor = new BearerProcessor(new Mock<IServiceFactory>().Object);

            Assert.IsTrue(processor.IsSatisfiedBy(context));
        }
Пример #6
0
        public void TestIsSatisfiedByFormTrue()
        {
            ResourceContext context = new ResourceContext();
            context.Form = new NameValueCollection();
            context.Form["bearer_token"] = "12345";

            BearerProcessor processor = new BearerProcessor(new Mock<IServiceFactory>().Object);

            Assert.IsTrue(processor.IsSatisfiedBy(context));
        }
        public void TestIsSatisfiedByHeaderTrue()
        {
            ResourceContext context = new ResourceContext();

            context.Headers = new NameValueCollection();
            context.Headers["Authorization"] = "Bearer 123456";

            BearerProcessor processor = new BearerProcessor(new Mock <IServiceFactory>().Object);

            Assert.IsTrue(processor.IsSatisfiedBy(context));
        }
        public void TestIsSatisfiedByFormTrue()
        {
            ResourceContext context = new ResourceContext();

            context.Form = new NameValueCollection();
            context.Form["bearer_token"] = "12345";

            BearerProcessor processor = new BearerProcessor(new Mock <IServiceFactory>().Object);

            Assert.IsTrue(processor.IsSatisfiedBy(context));
        }