File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public void Should_Merge_Two_Contexts()
2727 }
2828
2929 [ Fact ]
30+ [ Specification ( "3.2.2" , "Duplicate values being overwritten." ) ]
3031 public void Should_Merge_TwoContexts_And_Override_Duplicates_With_RightHand_Context ( )
3132 {
3233 var context1 = new EvaluationContext ( ) ;
@@ -77,5 +78,15 @@ public void EvaluationContext_Should_All_Types()
7778 context . Get < DateTime > ( "key4" ) . Should ( ) . Be ( now ) ;
7879 context . Get < TestStructure > ( "key5" ) . Should ( ) . Be ( structure ) ;
7980 }
81+
82+ [ Fact ]
83+ [ Specification ( "3.1.4" , "The evaluation context fields MUST have an unique key." ) ]
84+ public void When_Duplicate_Key_Throw_Unique_Constraint ( )
85+ {
86+ var context = new EvaluationContext { { "key" , "value" } } ;
87+ var exception = Assert . Throws < ArgumentException > ( ( ) =>
88+ context . Add ( "key" , "overriden_value" ) ) ;
89+ exception . Message . Should ( ) . Be ( "An item with the same key has already been added. Key: key" ) ;
90+ }
8091 }
8192}
You can’t perform that action at this time.
0 commit comments