public void When_the_element_is_not_in_the_set() { var element = 4; var sut = new CustomSet(new[] { 1, 2, 3 }); Assert.False(sut.Contains(element)); }
public void Nothing_is_contained_in_an_empty_set() { var element = 1; var sut = new CustomSet(); Assert.False(sut.Contains(element)); }
public CustomSet Difference(CustomSet right) { CustomSet res = this.Intersection(right); HashSet <int> res1 = new HashSet <int>(); foreach (int val in this.hash) { if (!right.Contains(val)) { res1.Add(val); } } return(new CustomSet(res1)); }
public void Detect_if_the_element_is_not_in_the_set() { var actual = new CustomSet <int>(new[] { 1, 2, 3 }); Assert.False(actual.Contains(4)); }
public void Nothing_is_contained_in_an_empty_set() { var actual = new CustomSet <int>(); Assert.False(actual.Contains(1)); }
public void Detect_if_the_element_is_in_the_set() { var actual = new CustomSet <int>(new[] { 1, 2, 3 }); Assert.That(actual.Contains(1), Is.True); }