Beispiel #1
0
        public void MarkAsSpam_Should_Use_HttpForm()
        {
            _httpForm.Expect(h => h.Post(ApiKeyCheckUrl, It.IsAny <NameValueCollection>())).Returns(ValidApiKeyResponse).Verifiable();
            _httpForm.Expect(h => h.PostAsync(SubmitUrl, It.IsAny <NameValueCollection>())).Verifiable();

            _spamProtection.MarkAsSpam(CreateDummyContent());

            _httpForm.Verify();
        }
        public void MarkAsSpam_Should_Use_HttpForm()
        {
            _httpForm.Setup(h => h.Post(It.Is <HttpFormPostRequest>(r => r.Url == ApiKeyCheckUrl))).Returns(new HttpFormResponse {
                Response = ValidApiKeyResponse
            }).Verifiable();
            _httpForm.Setup(h => h.PostAsync(It.IsAny <HttpFormPostRequest>())).Verifiable();

            _spamProtection.MarkAsSpam(CreateDummyContent());

            _httpForm.Verify();
        }