public async Task Process_NoParameters_Accepted()
        {
            var mocks = new Mocks();

            var map = new ParameterProcessorMap();
            await map.ProcessAsync(mocks.Connection.Object, new string[] { }, true);
        }
        public async Task Process_NoParameters_Accepted()
        {
            TestMocks mocks = new TestMocks();

            ParameterProcessorMap map = new ParameterProcessorMap();
            await map.Process(mocks.Connection.Object, new string[] { }, true).ConfigureAwait(false);
        }
Exemplo n.º 3
0
        public async Task Process_NoParameters_Accepted()
        {
            Mocks mocks = new Mocks();

            ParameterProcessorMap map = new ParameterProcessorMap();
            await map.ProcessAsync(mocks.Connection.Object, new string[] { }, true);
        }
        public void Process_NoParameters_Accepted()
        {
            Mocks mocks = new Mocks();

            ParameterProcessorMap map = new ParameterProcessorMap();

            map.Process(mocks.Connection.Object, new string[] { }, true);
        }
        public void Process_UnknownParameter_Throws()
        {
            Mocks mocks = new Mocks();

            ParameterProcessorMap map = new ParameterProcessorMap();

            map.Process(mocks.Connection.Object, new string[] { "KEYA=VALUEA" }, true);
        }
Exemplo n.º 6
0
        public void GetProcessor_RegisteredDifferentCase_Returned()
        {
            Mock<IParameterProcessor> processor = new Mock<IParameterProcessor>();

            ParameterProcessorMap map = new ParameterProcessorMap();
            map.SetProcessor("blah", processor.Object);

            Assert.Same(processor.Object, map.GetProcessor("BLAH"));
        }
        public void GetProcessor_RegisteredDifferentCase_Returned()
        {
            Mock <IParameterProcessor> processor = new Mock <IParameterProcessor>();

            ParameterProcessorMap map = new ParameterProcessorMap();

            map.SetProcessor("blah", processor.Object);

            Assert.AreSame(processor.Object, map.GetProcessor("BLAH"));
        }
        public void GetProcessor_Registered_Returned()
        {
            var processor = new Mock <IParameterProcessor>();

            var map = new ParameterProcessorMap();

            map.SetProcessor("BLAH", processor.Object);

            Assert.Same(processor.Object, map.GetProcessor("BLAH"));
        }
        public async Task Process_UnknownParameter_Throws()
        {
            var e = await Assert.ThrowsAsync <SmtpServerException>(async() =>
            {
                var mocks = new Mocks();

                var map = new ParameterProcessorMap();
                await map.ProcessAsync(mocks.Connection.Object, new string[] { "KEYA=VALUEA" }, true);
            });

            Assert.Equal("Parameter KEYA is not recognised", e.Message);
        }
        public async Task Process_UnknownParameter_Throws()
        {
            SmtpServerException e = await Assert.ThrowsAsync <SmtpServerException>(async() =>
            {
                TestMocks mocks = new TestMocks();

                ParameterProcessorMap map = new ParameterProcessorMap();
                await map.Process(mocks.Connection.Object, new string[] { "KEYA=VALUEA" }, true).ConfigureAwait(false);
            }).ConfigureAwait(false);

            Assert.Equal("Parameter KEYA is not recognised", e.Message);
        }
Exemplo n.º 11
0
        public async Task Process_UnknownParameter_Throws()
        {
            SmtpServerException e = await Assert.ThrowsAsync<SmtpServerException>(async () =>
           {
               Mocks mocks = new Mocks();

               ParameterProcessorMap map = new ParameterProcessorMap();
               await map.ProcessAsync(mocks.Connection.Object, new string[] { "KEYA=VALUEA" }, true);
           });

            Assert.Equal("Parameter KEYA is not recognised", e.Message);
        }
Exemplo n.º 12
0
        public async Task Process_KnownParameters_Processed()
        {
            Mocks mocks = new Mocks();
            Mock<IParameterProcessor> keyAProcessor = new Mock<IParameterProcessor>();
            Mock<IParameterProcessor> keyBProcessor = new Mock<IParameterProcessor>();

            ParameterProcessorMap map = new ParameterProcessorMap();
            map.SetProcessor("keya", keyAProcessor.Object);
            map.SetProcessor("keyb", keyBProcessor.Object);

            await map.ProcessAsync(mocks.Connection.Object, new string[] { "KEYA=VALUEA", "KEYB=VALUEB" }, true);

            keyAProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYA", "VALUEA"));
            keyBProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYB", "VALUEB"));
        }
        public async Task Process_KnownParameters_Processed()
        {
            var mocks         = new Mocks();
            var keyAProcessor = new Mock <IParameterProcessor>();
            var keyBProcessor = new Mock <IParameterProcessor>();

            var map = new ParameterProcessorMap();

            map.SetProcessor("keya", keyAProcessor.Object);
            map.SetProcessor("keyb", keyBProcessor.Object);

            await map.ProcessAsync(mocks.Connection.Object, new string[] { "KEYA=VALUEA", "KEYB=VALUEB" }, true);

            keyAProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYA", "VALUEA"));
            keyBProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYB", "VALUEB"));
        }
        public async Task Process_KnownParameters_Processed()
        {
            TestMocks mocks = new TestMocks();
            Mock <IParameterProcessor> keyAProcessor = new Mock <IParameterProcessor>();
            Mock <IParameterProcessor> keyBProcessor = new Mock <IParameterProcessor>();

            ParameterProcessorMap map = new ParameterProcessorMap();

            map.SetProcessor("keya", keyAProcessor.Object);
            map.SetProcessor("keyb", keyBProcessor.Object);

            await map.Process(mocks.Connection.Object, new string[] { "KEYA=VALUEA", "KEYB=VALUEB" }, true).ConfigureAwait(false);

            keyAProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYA", "VALUEA"));
            keyBProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYB", "VALUEB"));
        }
Exemplo n.º 15
0
        public void Process_KnownParameters_Processed()
        {
            Mocks mocks = new Mocks();
            Mock <IParameterProcessor> keyAProcessor = new Mock <IParameterProcessor>();
            Mock <IParameterProcessor> keyBProcessor = new Mock <IParameterProcessor>();

            ParameterProcessorMap map = new ParameterProcessorMap();

            map.SetProcessor("keya", keyAProcessor.Object);
            map.SetProcessor("keyb", keyBProcessor.Object);

            map.Process(mocks.Connection.Object, new string[] { "KEYA=VALUEA", "KEYB=VALUEB" }, true);

            keyAProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYA", "VALUEA"));
            keyBProcessor.Verify(p => p.SetParameter(mocks.Connection.Object, "KEYB", "VALUEB"));
        }
Exemplo n.º 16
0
 public void GetProcessor_NotRegistered_Null()
 {
     ParameterProcessorMap map = new ParameterProcessorMap();
     Assert.Null(map.GetProcessor("BLAH"));
 }
Exemplo n.º 17
0
        public void GetProcessor_NotRegistered_Null()
        {
            ParameterProcessorMap map = new ParameterProcessorMap();

            Assert.IsNull(map.GetProcessor("BLAH"));
        }
Exemplo n.º 18
0
 public MailFromVerb(ICurrentDateTimeProvider currentDateTimeProvider)
 {
     ParameterProcessorMap    = new ParameterProcessorMap();
     _currentDateTimeProvider = currentDateTimeProvider;
 }