public void ValidatePassesWithUrlAndHeaderKey()
        {
            var processor = this.mocks.StrictMock<IConfigurationErrorProcesser>();
            var condition = new UrlHeaderValueTaskCondition
                {
                    Url = "http://somewhere",
                    HeaderKey = "Key"
                };

            this.mocks.ReplayAll();
            condition.Validate(null, ConfigurationTrace.Start(this), processor);

            this.mocks.VerifyAll();
        }
        public void ValidateThrowsErrorsWithoutHeaderKey()
        {
            var processor = this.mocks.StrictMock<IConfigurationErrorProcesser>();
            var condition = new UrlHeaderValueTaskCondition
                {
                    Url = "http://somewhere"
                };
            Expect.Call(() => processor.ProcessError("Header Key cannot be empty"));

            this.mocks.ReplayAll();
            condition.Validate(null, ConfigurationTrace.Start(this), processor);

            this.mocks.VerifyAll();
        }
        public void EvaluateReturnsTrueIfValuesMatch()
        {
            var webMock = this.mocks.StrictMock<IWebFunctions>();
            Expect.Call(webMock.PingAndValidateHeaderValue("http://somewhere", "Key", "Value"))
                .Return(true);
            var condition = new UrlHeaderValueTaskCondition
                {
                    HeaderKey = "Key",
                    HeaderValue = "Value",
                    Url = "http://somewhere",
                    WebFunctions = webMock
                };
            var result = this.mocks.StrictMock<IIntegrationResult>();

            this.mocks.ReplayAll();
            var actual = condition.Eval(result);

            this.mocks.VerifyAll();
            Assert.IsTrue(actual);
        }