Пример #1
0
 public void should_return_passwordless_connection_string()
 {
     var connection = new MongoConnection("mongodb://*****:*****@hal/collection?yada");
     connection.ConnectionString.ShouldEqual("mongodb://username@hal/collection");
 }
Пример #2
0
 public void should_parse_username()
 {
     var connection = new MongoConnection("mongodb://*****:*****@localhost/collection?yada");
     connection.Username.ShouldEqual("username");
 }
Пример #3
0
 public void should_parse_remote_server_name()
 {
     var connection = new MongoConnection("mongodb://*****:*****@hal/collection?yada");
     connection.Server.ShouldEqual("hal");
 }
Пример #4
0
 public void should_parse_loopback_server_name()
 {
     var connection = new MongoConnection("mongodb://*****:*****@127.0.0.1/collection?yada");
     connection.Server.ShouldEqual(Environment.MachineName);
 }
Пример #5
0
 public void should_parse_default_database()
 {
     var connection = new MongoConnection("mongodb://*****:*****@localhost/collection?yada");
     connection.DefaultDatabase.ShouldEqual("collection");
 }
Пример #6
0
 public void should_not_parse_default_database_if_not_specified()
 {
     var connection = new MongoConnection("mongodb://*****:*****@localhost?yada");
     connection.DefaultDatabase.ShouldBeNull();
 }