@@ -84,7 +84,7 @@ public void SkipAutoPropsInRecords(bool skipAutoProps)
8484
8585 if ( skipAutoProps )
8686 {
87- TestInstrumentationHelper . GetCoverageResult ( path ) . GenerateReport ( show : true )
87+ TestInstrumentationHelper . GetCoverageResult ( path )
8888 . Document ( "Instrumentation.AutoProps.cs" )
8989 . AssertNonInstrumentedLines ( BuildConfiguration . Debug , 23 , 24 )
9090 . AssertNonInstrumentedLines ( BuildConfiguration . Release , 23 , 24 )
@@ -106,7 +106,7 @@ public void SkipAutoPropsInRecords(bool skipAutoProps)
106106 }
107107 }
108108
109- [ Theory ( Skip = "fails reason unknown (no session debug possible)" ) ]
109+ [ Theory ]
110110 [ InlineData ( true ) ]
111111 [ InlineData ( false ) ]
112112 public void SkipRecordWithProperties ( bool skipAutoProps )
@@ -116,7 +116,7 @@ public void SkipRecordWithProperties(bool skipAutoProps)
116116 {
117117 FunctionExecutor . Run ( async ( string [ ] parameters ) =>
118118 {
119- CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper . Run < ClassWithAutoRecordProperties > ( instance =>
119+ CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper . Run < ClassWithRecordsAutoProperties > ( instance =>
120120 {
121121 return Task . CompletedTask ;
122122 } ,
@@ -133,14 +133,56 @@ public void SkipRecordWithProperties(bool skipAutoProps)
133133 . AssertNonInstrumentedLines ( BuildConfiguration . Release , 29 , 29 )
134134 . AssertLinesCovered ( BuildConfiguration . Debug , ( 32 , 1 ) , ( 33 , 1 ) , ( 34 , 1 ) )
135135 . AssertLinesCovered ( BuildConfiguration . Release , ( 33 , 1 ) ) ;
136-
137136 }
138137 else
139138 {
140139 TestInstrumentationHelper . GetCoverageResult ( path )
141140 . Document ( "Instrumentation.AutoProps.cs" )
142- . AssertLinesCovered ( BuildConfiguration . Debug , ( 29 , 3 ) , ( 31 , 1 ) , ( 32 , 1 ) , ( 33 , 1 ) , ( 34 , 1 ) )
143- . AssertLinesCovered ( BuildConfiguration . Release , ( 29 , 3 ) , ( 31 , 1 ) , ( 33 , 1 ) ) ;
141+ . AssertLinesCovered ( BuildConfiguration . Debug , ( 29 , 1 ) , ( 31 , 1 ) , ( 32 , 1 ) , ( 33 , 1 ) , ( 34 , 1 ) )
142+ . AssertLinesCovered ( BuildConfiguration . Release , ( 29 , 1 ) , ( 31 , 1 ) , ( 33 , 1 ) ) ;
143+ }
144+ }
145+ finally
146+ {
147+ File . Delete ( path ) ;
148+ }
149+ }
150+
151+ [ Theory ]
152+ [ InlineData ( true ) ]
153+ [ InlineData ( false ) ]
154+ public void SkipInheritingRecordsWithProperties ( bool skipAutoProps )
155+ {
156+ string path = Path . GetTempFileName ( ) ;
157+ try
158+ {
159+ FunctionExecutor . Run ( async ( string [ ] parameters ) =>
160+ {
161+ CoveragePrepareResult coveragePrepareResult = await TestInstrumentationHelper . Run < ClassWithInheritingRecordsAndAutoProperties > ( instance =>
162+ {
163+ return Task . CompletedTask ;
164+ } ,
165+ persistPrepareResultToFile : parameters [ 0 ] , skipAutoProps : bool . Parse ( parameters [ 1 ] ) ) ;
166+
167+ return 0 ;
168+ } , new string [ ] { path , skipAutoProps . ToString ( ) } ) ;
169+
170+ if ( skipAutoProps )
171+ {
172+ TestInstrumentationHelper . GetCoverageResult ( path )
173+ . Document ( "Instrumentation.AutoProps.cs" )
174+ . AssertNonInstrumentedLines ( BuildConfiguration . Debug , 39 , 39 )
175+ . AssertNonInstrumentedLines ( BuildConfiguration . Release , 39 , 39 )
176+ . AssertLinesCovered ( BuildConfiguration . Debug , ( 41 , 1 ) , ( 44 , 1 ) , ( 45 , 1 ) , ( 46 , 1 ) )
177+ . AssertLinesCovered ( BuildConfiguration . Release , ( 45 , 1 ) ) ;
178+
179+ }
180+ else
181+ {
182+ TestInstrumentationHelper . GetCoverageResult ( path )
183+ . Document ( "Instrumentation.AutoProps.cs" )
184+ . AssertLinesCovered ( BuildConfiguration . Debug , ( 39 , 1 ) , ( 41 , 1 ) , ( 44 , 1 ) , ( 45 , 1 ) , ( 46 , 1 ) )
185+ . AssertLinesCovered ( BuildConfiguration . Release , ( 39 , 1 ) , ( 41 , 1 ) , ( 45 , 1 ) ) ;
144186 }
145187 }
146188 finally
0 commit comments