コード例 #1
0
 private void Invariants()
 {
     Contract.Invariant(AddedItems != null, "This property cannot be null");
     Contract.Invariant(RemovedItems != null, "This property cannot be null");
     Contract.Invariant(AddedItems.Intersect(RemovedItems).Count() == 0, "This property cannot be null");
 }
コード例 #2
0
 private void Invariants()
 {
     Contract.Invariant(AddedItems != null, "Added items cannot be a null reference");
     Contract.Invariant(RemovedItems != null, "Removed items cannot be a null reference");
     Contract.Invariant(AddedItems.Intersect(RemovedItems).Count == 0, "Added and removed item collection cannot match because it would mean that some items have been added and removed");
 }