Ejemplo n.º 1
0
        public async Task SayHelo()
        {
            var mocks = new Mocks();

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

            mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.Ok);
            mocks.Session.VerifySet(s => s.ClientName = "foo.blah");
        }
Ejemplo n.º 2
0
        public async Task SayHelo()
        {
            Mocks mocks = new Mocks();

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

            mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.OK);
            mocks.Session.VerifySet(s => s.ClientName = "foo.blah");
        }
Ejemplo n.º 3
0
        public async Task SayHelo_NoName()
        {
            Mocks mocks = new Mocks();

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

            mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.OK);
            mocks.Session.VerifySet(s => s.ClientName = "");
        }
Ejemplo n.º 4
0
        public async Task SayHeloTwice_ReturnsError()
        {
            Mocks mocks = new Mocks();
            mocks.Session.SetupGet(s => s.ClientName).Returns("already.said.helo");

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

            mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.BadSequenceOfCommands);
        }
Ejemplo n.º 5
0
        public async Task SayHeloTwice_ReturnsError()
        {
            var mocks = new Mocks();

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

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

            mocks.VerifyWriteResponseAsync(StandardSmtpResponseCode.BadSequenceOfCommands);
        }