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() { Mocks mocks = new Mocks(); ParameterProcessorMap map = new ParameterProcessorMap(); await map.ProcessAsync(mocks.Connection.Object, new string[] { }, true); }
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 () => { 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); }
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")); }