public void Should_read_smtp_password() { MockRepository mocks = new MockRepository(); IConfigurationReader reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetRequiredSetting("SmtpPassword")).Return("mypass"); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetSmtpPassword(), Is.EqualTo("mypass"));} }
public void Should_read_smtp_username() { var mocks = new MockRepository(); var reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetRequiredSetting("SmtpUsername")).Return("khurwitz"); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetSmtpUsername(), Is.EqualTo("khurwitz")); } mocks.VerifyAll(); }
public void Should_read_service_agent_factory() { var mocks = new MockRepository(); var reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetRequiredSetting("ServiceAgentFactory")).Return("my type"); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetServiceAgentFactory(), Is.EqualTo("my type")); } mocks.VerifyAll(); }
public void Should_read_smtp_authentication_necessary() { MockRepository mocks = new MockRepository(); IConfigurationReader reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetRequiredBooleanSetting("SmtpAuthenticationNecessary")).Return(true); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetSmtpAuthenticationNecessary(), Is.EqualTo(true));} }
public void Should_read_mapping_assemblies() { string[] mappingAssemblies = new string[0]; MockRepository mocks = new MockRepository(); IConfigurationReader reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetStringArray("MappingAssemblies")).Return(mappingAssemblies); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetMappingAssemblies(), Is.SameAs(mappingAssemblies)); } }
public void Should_read_show_sql() { MockRepository mocks = new MockRepository(); IConfigurationReader reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetOptionalBooleanSetting("ShowSql")).Return(true); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetShowSql(), Is.EqualTo(true));} }
public void Should_read_service_sleep_time() { MockRepository mocks = new MockRepository(); IConfigurationReader reader = mocks.CreateMock<IConfigurationReader>(); using (mocks.Record()) { Expect.Call(reader.GetRequiredIntegerSetting("ServiceSleepTime")).Return(7); } using (mocks.Playback()) { IApplicationSettings settings = new ApplicationSettings(reader); Assert.That(settings.GetServiceSleepTime(), Is.EqualTo(7));} }