public void InitWithNullContextThrowsArgumentNullException()
        {
            var sut = new JwtValidationModule();

            var ex = Assert.Throws <ArgumentNullException>(() => sut.Init(null));

            Assert.Equal("context", ex.ParamName);
        }
        public void InitWithValidContextSucceeds()
        {
            var sut     = new JwtValidationModule();
            var testApp = new TestApplication(new TokenValidationParameters()
            {
                AllowedAudiences = this.allowedAudiences,
                SigningToken     = new X509SecurityToken(this.certificate),
                ValidIssuer      = "self"
            });

            sut.Init(testApp);

            // TODO: Find a way to verify we are properly registering to AuthenticateRequest.
        }
        public void InitWithValidContextSucceeds()
        {
            var sut = new JwtValidationModule();
            var testApp = new TestApplication(new TokenValidationParameters()
                {
                    AllowedAudiences = this.allowedAudiences,
                    SigningToken = new X509SecurityToken(this.certificate),
                    ValidIssuer = "self"
                });

            sut.Init(testApp);

            // TODO: Find a way to verify we are properly registering to AuthenticateRequest.
        }
        public void InitWithNullContextThrowsArgumentNullException()
        {
            var sut = new JwtValidationModule();

            var ex = Assert.Throws<ArgumentNullException>(() => sut.Init(null));

            Assert.Equal("context", ex.ParamName);
        }
        public void InitWithInvalidContextThrowsInvalidOperationException()
        {
            var sut = new JwtValidationModule();

            Assert.Throws<InvalidOperationException>(() => sut.Init(new HttpApplication()));
        }
        public void InitWithInvalidContextThrowsInvalidOperationException()
        {
            var sut = new JwtValidationModule();

            Assert.Throws <InvalidOperationException>(() => sut.Init(new HttpApplication()));
        }