@@ -191,10 +191,10 @@ public static void Tag(string name, object arg) {{ }}
191
191
}}" ;
192
192
var validator = new SETestContext ( code , AnalyzerLanguage . CSharp , Array . Empty < SymbolicCheck > ( ) ) . Validator ;
193
193
validator . ValidateContainsOperation ( OperationKind . Invocation ) ;
194
- validator . ValidateTag ( "BeforeField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
195
- validator . ValidateTag ( "BeforeStaticField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
196
- validator . ValidateTag ( "AfterField" , x => x . Constraint < ObjectConstraint > ( ) . Should ( ) . BeNull ( ) ) ;
197
- validator . ValidateTag ( "AfterStaticField" , x => x . Constraint < ObjectConstraint > ( ) . Should ( ) . BeNull ( ) ) ;
194
+ validator . TagValue ( "BeforeField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
195
+ validator . TagValue ( "BeforeStaticField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
196
+ validator . TagValue ( "AfterField" ) . Should ( ) . BeNull ( ) ;
197
+ validator . TagValue ( "AfterStaticField" ) . Should ( ) . BeNull ( ) ;
198
198
}
199
199
200
200
[ DataTestMethod ]
@@ -277,8 +277,8 @@ public static void Tag(string name) {{ }}
277
277
x => // Branch for "this"
278
278
{
279
279
x [ condition ] . Should ( ) . BeNull ( ) ; // Should have BoolConstraint.True
280
- x [ field ] . AllConstraints . Should ( ) . BeEmpty ( ) ;
281
- x [ staticField ] . AllConstraints . Should ( ) . BeEmpty ( ) ;
280
+ x [ field ] . Should ( ) . BeNull ( ) ;
281
+ x [ staticField ] . Should ( ) . BeNull ( ) ;
282
282
} ,
283
283
x => // Branch for "otherInstance"
284
284
{
@@ -387,7 +387,7 @@ public void Instance_InstanceMethodCall_ClearsField()
387
387
var validator = SETestContext . CreateCS ( code ) . Validator ;
388
388
validator . TagValues ( "After" ) . Should ( ) . Equal (
389
389
SymbolicValue . Empty . WithConstraint ( ObjectConstraint . NotNull ) ,
390
- SymbolicValue . Empty ) ;
390
+ null ) ;
391
391
}
392
392
393
393
[ TestMethod ]
@@ -398,7 +398,7 @@ public void Instance_InstanceMethodCall_ClearsFieldWithBranchInArgument()
398
398
this.InstanceMethod(boolParameter ? 1 : 0);
399
399
Tag(""After"", this.ObjectField);" ;
400
400
var validator = SETestContext . CreateCS ( code ) . Validator ;
401
- validator . ValidateTag ( "After" , x => x . AllConstraints . Should ( ) . BeEmpty ( ) ) ;
401
+ validator . TagValue ( "After" ) . Should ( ) . BeNull ( ) ;
402
402
}
403
403
404
404
[ TestMethod ]
@@ -465,28 +465,28 @@ public class Other
465
465
public static void OtherMethod() { }
466
466
}" ;
467
467
var validator = new SETestContext ( code , AnalyzerLanguage . CSharp , Array . Empty < SymbolicCheck > ( ) ) . Validator ;
468
- validator . ValidateTag ( "Start_Base_BaseField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
469
- validator . ValidateTag ( "Start_Other_OtherField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
470
- validator . ValidateTag ( "Start_Sample_SampleField1" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
471
- validator . ValidateTag ( "Start_Sample_SampleField2" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
468
+ validator . TagValue ( "Start_Base_BaseField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
469
+ validator . TagValue ( "Start_Other_OtherField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
470
+ validator . TagValue ( "Start_Sample_SampleField1" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
471
+ validator . TagValue ( "Start_Sample_SampleField2" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
472
472
473
473
// SampleMethod() resets own field and base class fields, but not other class fields
474
- validator . ValidateTag ( "SampleMethod_Base_BaseField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
475
- validator . ValidateTag ( "SampleMethod_Other_OtherField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
476
- validator . ValidateTag ( "SampleMethod_Sample_SampleField1" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
477
- validator . ValidateTag ( "SampleMethod_Sample_SampleField2" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
474
+ validator . TagValue ( "SampleMethod_Base_BaseField" ) . Should ( ) . BeNull ( ) ;
475
+ validator . TagValue ( "SampleMethod_Other_OtherField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
476
+ validator . TagValue ( "SampleMethod_Sample_SampleField1" ) . Should ( ) . BeNull ( ) ;
477
+ validator . TagValue ( "SampleMethod_Sample_SampleField2" ) . Should ( ) . BeNull ( ) ;
478
478
479
479
// OtherMethod() resets only its own constraints
480
- validator . ValidateTag ( "OtherMethod_Base_BaseField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
481
- validator . ValidateTag ( "OtherMethod_Other_OtherField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
482
- validator . ValidateTag ( "OtherMethod_Sample_SampleField1" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
483
- validator . ValidateTag ( "OtherMethod_Sample_SampleField2" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
480
+ validator . TagValue ( "OtherMethod_Base_BaseField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
481
+ validator . TagValue ( "OtherMethod_Other_OtherField" ) . Should ( ) . BeNull ( ) ;
482
+ validator . TagValue ( "OtherMethod_Sample_SampleField1" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
483
+ validator . TagValue ( "OtherMethod_Sample_SampleField2" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
484
484
485
485
// BaseMethod() called from Sample only resets Base field
486
- validator . ValidateTag ( "BaseMethod_Base_BaseField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
487
- validator . ValidateTag ( "BaseMethod_Other_OtherField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
488
- validator . ValidateTag ( "BaseMethod_Sample_SampleField1" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
489
- validator . ValidateTag ( "BaseMethod_Sample_SampleField2" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
486
+ validator . TagValue ( "BaseMethod_Base_BaseField" ) . Should ( ) . BeNull ( ) ;
487
+ validator . TagValue ( "BaseMethod_Other_OtherField" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
488
+ validator . TagValue ( "BaseMethod_Sample_SampleField1" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
489
+ validator . TagValue ( "BaseMethod_Sample_SampleField2" ) . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ;
490
490
}
491
491
492
492
[ DataTestMethod ]
@@ -507,7 +507,7 @@ public void Invocation_StaticMethodCall_DoesNotClearInstanceFields(string invoca
507
507
validator . ValidateTag ( "BeforeField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
508
508
validator . ValidateTag ( "BeforeStaticField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
509
509
validator . ValidateTag ( "AfterField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeTrue ( ) ) ;
510
- validator . ValidateTag ( "AfterStaticField" , x => x . HasConstraint ( ObjectConstraint . Null ) . Should ( ) . BeFalse ( ) ) ;
510
+ validator . ValidateTag ( "AfterStaticField" , x => x . Should ( ) . BeNull ( ) ) ;
511
511
}
512
512
513
513
[ TestMethod ]
0 commit comments