コード例 #1
0
ファイル: HeloVerbTests.cs プロジェクト: LiDamon/smtp4dev
        public void SayHelo()
        {
            Mocks mocks = new Mocks();

            HeloVerb verb = new HeloVerb();
            verb.Process(mocks.Connection.Object, new SmtpCommand("HELO foo.blah"));

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.OK);
            mocks.Session.VerifySet(s => s.ClientName, "foo.bar");
        }
コード例 #2
0
        public async Task SayHelo_NoName()
        {
            TestMocks mocks = new TestMocks();

            HeloVerb verb = new HeloVerb();
            await verb.Process(mocks.Connection.Object, new SmtpCommand("HELO")).ConfigureAwait(false);

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.OK);
            mocks.Session.VerifySet(s => s.ClientName = "");
        }
コード例 #3
0
ファイル: HeloVerbTests.cs プロジェクト: LiDamon/smtp4dev
        public void SayHeloTwice_ReturnsError()
        {
            Mocks mocks = new Mocks();
            mocks.Session.SetupGet(s => s.ClientName).Returns("already.said.helo");
            mocks.Session.SetupSet(s => s.ClientName).Never();

            HeloVerb verb = new HeloVerb();
            verb.Process(mocks.Connection.Object, new SmtpCommand("HELO foo.blah"));

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.BadSequenceOfCommands);
        }
コード例 #4
0
ファイル: HeloVerbTests.cs プロジェクト: ikastech/smtp4qa
        public void SayHelo()
        {
            Mocks mocks = new Mocks();

            HeloVerb verb = new HeloVerb();

            verb.Process(mocks.Connection.Object, new SmtpCommand("HELO foo.blah"));

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.OK);
            mocks.Session.VerifySet(s => s.ClientName, "foo.bar");
        }
コード例 #5
0
        public async Task SayHeloTwice_ReturnsError()
        {
            TestMocks mocks = new TestMocks();

            mocks.Session.SetupGet(s => s.ClientName).Returns("already.said.helo");

            HeloVerb verb = new HeloVerb();
            await verb.Process(mocks.Connection.Object, new SmtpCommand("HELO foo.blah")).ConfigureAwait(false);

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.BadSequenceOfCommands);
        }
コード例 #6
0
ファイル: HeloVerbTests.cs プロジェクト: hmoriya/smtp4dev
        public void SayHeloTwice_ReturnsError()
        {
            Mocks mocks = new Mocks();

            mocks.Session.SetupGet(s => s.ClientName).Returns("already.said.helo");

            HeloVerb verb = new HeloVerb();

            verb.Process(mocks.Connection.Object, new SmtpCommand("HELO foo.blah"));

            mocks.VerifyWriteResponse(StandardSmtpResponseCode.BadSequenceOfCommands);
        }