public async Task GetConnectionAsync_ReturnOpenedConnection_When_PassingRealConnectionStringToCtor() { var factory = new SqlCeConnectionFactory(this.TestConnectionString); using (IDbConnection connection = await factory.GetConnectionAsync()) { Assert.AreEqual(ConnectionState.Open, connection.State); } }
public void GetConnectionAsync_DoesNoThrow_When_PassingRealConnectionStringToCtor() { var factory = new SqlCeConnectionFactory(this.TestConnectionString); Assert.DoesNotThrowAsync(async() => { using (await factory.GetConnectionAsync()) { } }); }
public void GetConnectionAsync_Throws_When_PassingRealConnectionStringToCtor() { var factory = new SqlCeConnectionFactory(@"Data Source=C:\Users\test_compact_db.sdf"); Assert.ThrowsAsync <SqlCeException>(async() => { using (IDbConnection connection = await factory.GetConnectionAsync()) { Assert.AreEqual(ConnectionState.Open, connection.State); } }); }