Created
April 14, 2014 12:08
-
-
Save ronnieoverby/10641883 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
public abstract class Testing : DbConnectionWrapper | |
{ | |
public bool CtorCalled { get; set; } | |
protected Testing(IDbConnection innerConnection) | |
: base(innerConnection) | |
{ | |
CtorCalled = true; | |
} | |
} | |
[Test] | |
public void Abstract_Class_Ctor_Called_With_Inner_Connection() | |
{ | |
var t = _conn.As<Testing>(); | |
Assert.True(t.CtorCalled); // fails | |
} | |
[Test] | |
public void Abstract_Class_Has_Inner_Connection() | |
{ | |
var t = _conn.As<Testing>(); | |
// throws null reference exception | |
var connectionString = t.ConnectionString; | |
Assert.NotNull(connectionString); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment