@@ -92,67 +92,67 @@ public async Task OneScalarFieldAndEmptyDerived_HasCreateMethod()
9292 public async Task OneScalarField_HasWithMethod ( )
9393 {
9494 var result = await this . GenerateFromStreamAsync ( "OneScalarField" ) ;
95- Assert . True ( result . DeclaredMethods . Any ( m => m . Name == "With" && m . Parameters . Single ( ) . Name == "seeds" && ! m . IsStatic ) ) ;
95+ Assert . Contains ( result . DeclaredMethods , m => m . Name == "With" && m . Parameters . Single ( ) . Name == "seeds" && ! m . IsStatic ) ;
9696 }
9797
9898 [ Fact ]
9999 public async Task OneScalarField_HasCreateMethod ( )
100100 {
101101 var result = await this . GenerateFromStreamAsync ( "OneScalarField" ) ;
102- Assert . True ( result . DeclaredMethods . Any ( m => m . Name == "Create" && m . Parameters . Single ( ) . Name == "seeds" ) ) ;
102+ Assert . Contains ( result . DeclaredMethods , m => m . Name == "Create" && m . Parameters . Single ( ) . Name == "seeds" ) ;
103103 }
104104
105105 [ Fact ]
106106 public async Task OneScalarFieldWithBuilder_HasToBuilderMethod ( )
107107 {
108108 var result = await this . GenerateFromStreamAsync ( "OneScalarFieldWithBuilder" ) ;
109- Assert . True ( result . DeclaredMethods . Any ( m => m . Name == "ToBuilder" && m . Parameters . Length == 0 && ! m . IsStatic ) ) ;
109+ Assert . Contains ( result . DeclaredMethods , m => m . Name == "ToBuilder" && m . Parameters . Length == 0 && ! m . IsStatic ) ;
110110 }
111111
112112 [ Fact ]
113113 public async Task OneScalarFieldWithBuilder_HasCreateBuilderMethod ( )
114114 {
115115 var result = await this . GenerateFromStreamAsync ( "OneScalarFieldWithBuilder" ) ;
116- Assert . True ( result . DeclaredMethods . Any ( m => m . Name == "CreateBuilder" && m . Parameters . Length == 0 && m . IsStatic ) ) ;
116+ Assert . Contains ( result . DeclaredMethods , m => m . Name == "CreateBuilder" && m . Parameters . Length == 0 && m . IsStatic ) ;
117117 }
118118
119119 [ Fact ]
120120 public async Task OneScalarFieldWithBuilder_BuilderHasMutableProperties ( )
121121 {
122122 var result = await this . GenerateFromStreamAsync ( "OneScalarFieldWithBuilder" ) ;
123- Assert . True ( result . DeclaredProperties . Any ( p => p . ContainingType ? . Name == "Builder" && p . Name == "Seeds" && p . SetMethod != null && p . GetMethod != null ) ) ;
123+ Assert . Contains ( result . DeclaredProperties , p => p . ContainingType ? . Name == "Builder" && p . Name == "Seeds" && p . SetMethod != null && p . GetMethod != null ) ;
124124 }
125125
126126 [ Fact ]
127127 public async Task OneScalarFieldWithBuilder_BuilderHasToImmutableMethod ( )
128128 {
129129 var result = await this . GenerateFromStreamAsync ( "OneScalarFieldWithBuilder" ) ;
130- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Builder" && m . Name == "ToImmutable" && m . Parameters . Length == 0 && ! m . IsStatic ) ) ;
130+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Builder" && m . Name == "ToImmutable" && m . Parameters . Length == 0 && ! m . IsStatic ) ;
131131 }
132132
133133 [ Fact ]
134134 public async Task ClassDerivesFromAnotherWithFields_DerivedCreateParametersIncludeBaseFields ( )
135135 {
136136 var result = await this . GenerateFromStreamAsync ( "ClassDerivesFromAnotherWithFields" ) ;
137- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Fruit" && m . Name == "Create" && m . Parameters . Length == 1 ) ) ;
138- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Apple" && m . Name == "Create" && m . Parameters . Length == 2 ) ) ;
137+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Fruit" && m . Name == "Create" && m . Parameters . Length == 1 ) ;
138+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Apple" && m . Name == "Create" && m . Parameters . Length == 2 ) ;
139139 }
140140
141141 [ Fact ]
142142 public async Task ClassDerivesFromAnotherWithFields_DerivedWithParametersIncludeBaseFields ( )
143143 {
144144 var result = await this . GenerateFromStreamAsync ( "ClassDerivesFromAnotherWithFields" ) ;
145- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Fruit" && m . Name == "With" && m . Parameters . Length == 1 ) ) ;
146- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Apple" && m . Name == "With" && m . Parameters . Length == 2 ) ) ;
145+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Fruit" && m . Name == "With" && m . Parameters . Length == 1 ) ;
146+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Apple" && m . Name == "With" && m . Parameters . Length == 2 ) ;
147147 }
148148
149149 [ Fact ]
150150 public async Task ClassDerivesFromAnotherWithFields_DerivedWithCoreParametersIncludeBaseFields ( )
151151 {
152152 var result = await this . GenerateFromStreamAsync ( "ClassDerivesFromAnotherWithFields" ) ;
153- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Fruit" && m . Name == "WithCore" && m . Parameters . Length == 1 && m . IsVirtual ) ) ;
154- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Apple" && m . Name == "WithCore" && m . Parameters . Length == 1 && m . IsOverride ) ) ;
155- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType ? . Name == "Apple" && m . Name == "WithCore" && m . Parameters . Length == 2 && m . IsVirtual ) ) ;
153+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Fruit" && m . Name == "WithCore" && m . Parameters . Length == 1 && m . IsVirtual ) ;
154+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Apple" && m . Name == "WithCore" && m . Parameters . Length == 1 && m . IsOverride ) ;
155+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType ? . Name == "Apple" && m . Name == "WithCore" && m . Parameters . Length == 2 && m . IsVirtual ) ;
156156 }
157157
158158 [ Fact ]
@@ -167,40 +167,40 @@ public async Task ClassDerivesFromAnotherWithFieldsAndBuilder_BuildersReflectTyp
167167 public async Task AbstractNonEmptyWithDerivedEmpty_HasCreateOnlyInNonAbstractClass ( )
168168 {
169169 var result = await this . GenerateFromStreamAsync ( "AbstractNonEmptyWithDerivedEmpty" ) ;
170- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "Create" && m . Parameters . Single ( ) . Name == "oneField" ) ) ;
171- Assert . False ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "Create" ) ) ;
170+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "Create" && m . Parameters . Single ( ) . Name == "oneField" ) ;
171+ Assert . DoesNotContain ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "Create" ) ;
172172 }
173173
174174 [ Fact ]
175175 public async Task AbstractNonEmptyWithDerivedEmpty_HasValidateMethodOnBothTypes ( )
176176 {
177177 var result = await this . GenerateFromStreamAsync ( "AbstractNonEmptyWithDerivedEmpty" ) ;
178- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "Validate" ) ) ;
179- Assert . False ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "Validate" ) ) ;
178+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "Validate" ) ;
179+ Assert . DoesNotContain ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "Validate" ) ;
180180 }
181181
182182 [ Fact ]
183183 public async Task AbstractNonEmptyWithDerivedEmpty_HasWithMethodOnBothTypes ( )
184184 {
185185 var result = await this . GenerateFromStreamAsync ( "AbstractNonEmptyWithDerivedEmpty" ) ;
186- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "With" && m . Parameters . Single ( ) . Name == "oneField" ) ) ;
187- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "With" && m . Parameters . Single ( ) . Name == "oneField" ) ) ;
186+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "With" && m . Parameters . Single ( ) . Name == "oneField" ) ;
187+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "With" && m . Parameters . Single ( ) . Name == "oneField" ) ;
188188 }
189189
190190 [ Fact ]
191191 public async Task AbstractNonEmptyWithDerivedEmpty_HasWithCoreMethodOnBothTypes ( )
192192 {
193193 var result = await this . GenerateFromStreamAsync ( "AbstractNonEmptyWithDerivedEmpty" ) ;
194- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "WithCore" && m . Parameters . Single ( ) . Name == "oneField" ) ) ;
195- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "WithCore" && m . Parameters . Single ( ) . Name == "oneField" ) ) ;
194+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "WithCore" && m . Parameters . Single ( ) . Name == "oneField" ) ;
195+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "WithCore" && m . Parameters . Single ( ) . Name == "oneField" ) ;
196196 }
197197
198198 [ Fact ]
199199 public async Task AbstractNonEmptyWithDerivedEmpty_HasWithFactoryMethodOnConcreteTypeOnly ( )
200200 {
201201 var result = await this . GenerateFromStreamAsync ( "AbstractNonEmptyWithDerivedEmpty" ) ;
202- Assert . True ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "WithFactory" && m . Parameters . Length == 2 ) ) ;
203- Assert . False ( result . DeclaredMethods . Any ( m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "WithFactory" && m . Parameters . Length == 2 ) ) ;
202+ Assert . Contains ( result . DeclaredMethods , m => m . ContainingType . Name == "EmptyDerivedFromAbstract" && m . Name == "WithFactory" && m . Parameters . Length == 2 ) ;
203+ Assert . DoesNotContain ( result . DeclaredMethods , m => m . ContainingType . Name == "AbstractNonEmpty" && m . Name == "WithFactory" && m . Parameters . Length == 2 ) ;
204204 }
205205
206206 [ Fact ]
0 commit comments