@@ -106,12 +106,17 @@ public void TheTest() { }
106106 }
107107
108108 [ Fact ]
109- public void TestClassWithThrowingFixtureConstructorResultsInFailedTest ( )
109+ public void TestClassWithoutCtorWithThrowingFixtureConstructorResultsInFailedTest ( )
110110 {
111111 var messages = Run < ITestFailed > ( typeof ( ClassWithThrowingFixtureCtor ) ) ;
112112
113113 var msg = Assert . Single ( messages ) ;
114- Assert . Equal ( typeof ( DivideByZeroException ) . FullName , msg . ExceptionTypes . Single ( ) ) ;
114+ Assert . Collection (
115+ msg . ExceptionTypes ,
116+ exceptionTypeName => Assert . Equal ( typeof ( TestClassException ) . FullName , exceptionTypeName ) ,
117+ exceptionTypeName => Assert . Equal ( typeof ( DivideByZeroException ) . FullName , exceptionTypeName )
118+ ) ;
119+ Assert . Equal ( "Class fixture type 'FixtureAcceptanceTests+ThrowingCtorFixture' threw in its constructor" , msg . Messages . First ( ) ) ;
115120 }
116121
117122 class ClassWithThrowingFixtureCtor : IClassFixture < ThrowingCtorFixture >
@@ -120,6 +125,28 @@ class ClassWithThrowingFixtureCtor : IClassFixture<ThrowingCtorFixture>
120125 public void TheTest ( ) { }
121126 }
122127
128+ [ Fact ]
129+ public void TestClassWithCtorWithThrowingFixtureConstructorResultsInFailedTest ( )
130+ {
131+ var messages = Run < ITestFailed > ( typeof ( ClassWithCtorAndThrowingFixtureCtor ) ) ;
132+
133+ var msg = Assert . Single ( messages ) ;
134+ Assert . Collection (
135+ msg . ExceptionTypes ,
136+ exceptionTypeName => Assert . Equal ( typeof ( TestClassException ) . FullName , exceptionTypeName ) ,
137+ exceptionTypeName => Assert . Equal ( typeof ( DivideByZeroException ) . FullName , exceptionTypeName )
138+ ) ;
139+ Assert . Equal ( "Class fixture type 'FixtureAcceptanceTests+ThrowingCtorFixture' threw in its constructor" , msg . Messages . First ( ) ) ;
140+ }
141+
142+ class ClassWithCtorAndThrowingFixtureCtor : IClassFixture < ThrowingCtorFixture >
143+ {
144+ public ClassWithCtorAndThrowingFixtureCtor ( ThrowingCtorFixture _ ) { }
145+
146+ [ Fact ]
147+ public void TheTest ( ) { }
148+ }
149+
123150 [ Fact ]
124151 public void TestClassWithThrowingFixtureDisposeResultsInFailedTest ( )
125152 {
@@ -186,7 +213,7 @@ public void TestClassWithOptionalParameter()
186213
187214 class ClassWithOptionalCtorArg : IClassFixture < EmptyFixtureData >
188215 {
189- public ClassWithOptionalCtorArg ( EmptyFixtureData fixture , [ Optional ] int x , [ Optional ] object y )
216+ public ClassWithOptionalCtorArg ( EmptyFixtureData fixture , [ Optional ] int x , [ Optional ] object y )
190217 {
191218 Assert . NotNull ( fixture ) ;
192219 Assert . Equal ( 0 , x ) ;
0 commit comments