Created
June 29, 2015 18:08
-
-
Save christopherbauer/7992511a879f4a695702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class when_getting_the_a_connection | |
{ | |
[Test] | |
public void then_should_return_a_new_instance_of_an_odbc_connection() | |
{ | |
// Arrange | |
const string connectionString = "Server=Localhost;"; | |
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | |
config.ConnectionStrings.ConnectionStrings.Remove("AS400ConnectionString"); | |
config.ConnectionStrings.ConnectionStrings.Add(new ConnectionStringSettings("AS400ConnectionString", connectionString)); | |
config.Save(ConfigurationSaveMode.Modified, true); | |
ConfigurationManager.RefreshSection("connectionStrings"); | |
var provider = new DbConnectionProvider(); | |
// Act | |
var connection = provider.As400Connection; | |
// Assert | |
Assert.That(connection, Is.Not.Null.And.Matches<OdbcConnection>(c => c.ConnectionString == connectionString)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment