public void Test_Ctor() { AddOnlySet <string> addOnlySet; addOnlySet = new AddOnlySet <string>(); Assert.That(addOnlySet, Has.Count.EqualTo(0)); }
/// <summary> /// Create a new <see cref="CacheContextEntry"/>. /// </summary> public CacheContextEntry() { Entities = new AddOnlySet <long>( ); RelationshipTypes = new AddOnlySet <long>( ); FieldTypes = new AddOnlySet <long>( ); EntityInvalidatingRelationshipTypes = new AddOnlySet <long>( ); EntityTypes = new AddOnlySet <long>( ); }
public void Test_AddSingle() { AddOnlySet <string> addOnlySet; addOnlySet = new AddOnlySet <string>(); addOnlySet.Add("foo"); Assert.That(addOnlySet, Has.Exactly(1).EqualTo("foo")); }
public void Test_AddMultiple() { AddOnlySet <string> addOnlySet; addOnlySet = new AddOnlySet <string>(); addOnlySet.Add("foo", "bar"); Assert.That(addOnlySet, Has.Count.EqualTo(2)); Assert.That(addOnlySet, Has.Exactly(1).EqualTo("foo")); Assert.That(addOnlySet, Has.Exactly(1).EqualTo("bar")); }
public void Test_ItemsAddedDuplicateInList() { AddOnlySet <string> addOnlySet; List <string> itemsAdded; itemsAdded = new List <string>(); addOnlySet = new AddOnlySet <string>(); addOnlySet.ItemsAdded += (sender, args) => itemsAdded.AddRange(args.Items); addOnlySet.Add("foo", "foo"); Assert.That(itemsAdded, Is.EquivalentTo(new[] { "foo" })); }
public void Test_ItemsAddedDuplicateInSet() { AddOnlySet <string> addOnlySet; List <string> itemsAdded; itemsAdded = new List <string>(); addOnlySet = new AddOnlySet <string>(); addOnlySet.Add("foo"); addOnlySet.ItemsAdded += (sender, args) => itemsAdded.AddRange(args.Items); addOnlySet.Add("foo"); Assert.That(itemsAdded, Is.Empty); }