public void ProcessResponse_Response_BadBase64() { Mocks mocks = new Mocks(); CramMd5MechanismProcessor cramMd5MechanismProcessor = Setup(mocks); cramMd5MechanismProcessor.ProcessResponse(null); cramMd5MechanismProcessor.ProcessResponse("rob blah"); }
public void ProcessRepsonse_ChallengeReponse_BadFormat() { Mocks mocks = new Mocks(); string challenge = string.Format("{0}.{1}@{2}", FAKERANDOM, FAKEDATETIME, FAKEDOMAIN); CramMd5MechanismProcessor cramMd5MechanismProcessor = Setup(mocks, challenge); AuthMechanismProcessorStatus result = cramMd5MechanismProcessor.ProcessResponse("BLAH"); }
public async Task ProcessResponse_Response_BadBase64() { await Assert.ThrowsAsync <BadBase64Exception>(async() => { TestMocks mocks = new TestMocks(); CramMd5MechanismProcessor cramMd5MechanismProcessor = this.Setup(mocks); await cramMd5MechanismProcessor.ProcessResponse(null).ConfigureAwait(false); await cramMd5MechanismProcessor.ProcessResponse("rob blah").ConfigureAwait(false); }).ConfigureAwait(false); }
public async Task ProcessResponse_Response_BadBase64() { await Assert.ThrowsAsync <BadBase64Exception>(async() => { Mocks mocks = new Mocks(); CramMd5MechanismProcessor cramMd5MechanismProcessor = Setup(mocks); await cramMd5MechanismProcessor.ProcessResponseAsync(null); await cramMd5MechanismProcessor.ProcessResponseAsync("rob blah"); }); }
public async Task ProcessRepsonse_ChallengeReponse_BadFormat() { await Assert.ThrowsAsync <SmtpServerException>(async() => { TestMocks mocks = new TestMocks(); string challenge = string.Format("{0}.{1}@{2}", FAKERANDOM, FAKEDATETIME, FAKEDOMAIN); CramMd5MechanismProcessor cramMd5MechanismProcessor = this.Setup(mocks, challenge); AuthMechanismProcessorStatus result = await cramMd5MechanismProcessor.ProcessResponse("BLAH").ConfigureAwait(false); }).ConfigureAwait(false); }
public void ProcessRepsonse_GetChallenge() { Mocks mocks = new Mocks(); CramMd5MechanismProcessor cramMd5MechanismProcessor = Setup(mocks); AuthMechanismProcessorStatus result = cramMd5MechanismProcessor.ProcessResponse(null); string expectedResponse = string.Format("{0}.{1}@{2}", FAKERANDOM, FAKEDATETIME, FAKEDOMAIN); Assert.AreEqual(AuthMechanismProcessorStatus.Continue, result); mocks.Connection.Verify( c => c.WriteResponse( It.Is <SmtpResponse>(r => r.Code == (int)StandardSmtpResponseCode.AuthenticationContinue && VerifyBase64Response(r.Message, expectedResponse) ) ) ); }