コード例 #1
0
        public void IsRequestAuthorized_requestToUnprotectedUrl_shouldAllowRequest()
        {
            // Arrange
            var module = new HmacHttpModule();

            module.Init(new HttpApplication());
            var service = (HmacHttpService)module.HmacHttpService;

            // Act
            var actual = service.IsRequestAuthorized(GetValidRawUrl(false), CreateInvalidQueryString());

            // Assert
            Assert.AreEqual(StatusCode.Authorized, actual);

            module.Dispose();
        }
コード例 #2
0
        public void Init_noHttpServiceSet_shouldCreateDefaultService()
        {
            // Arrange
            var module = new HmacHttpModule();

            // Act
            module.Init(new HttpApplication());

            // Assert
            var actual = (HmacHttpService)module.HmacHttpService;

            Assert.IsNotNull(actual);
            Assert.IsNotNull(actual.UserRepository);
            Assert.IsNotNull(actual.AppRepository);
            Assert.IsNotNull(actual.HmacService);

            module.Dispose();
        }