public void Contains_Should_BeCoherent_ObjectNotFound(string value, string lookingfor) { var target = new SingleSet <string>(null, value); var res = target.Contains(lookingfor); res.Should().BeFalse(); }
public void Contains_Should_BeCoherent_ObjectFound(string value) { var target = new SingleSet <string>(null, value); var res = target.Contains(value); res.Should().BeTrue(); }
internal void Remove_ReturnSelf(SingleSet <string> target, string removed) { bool success; var expected = new HashSet <string>(target); bool result = expected.Remove(removed); var res = target.Remove(removed, out success); res.Should().BeSameAs(target); }
public void SingleSet_NewSingleSet() { var singleSet = new SingleSet(); Assert.False(singleSet.Value, "Single set is set!"); Assert.False(singleSet.Set(), "Single set is set!"); Assert.True(singleSet.Value, "Single not set is set!"); Assert.True(singleSet.Set(), "Single not set is set!"); Assert.True(singleSet.Value, "Single not set is set!"); Assert.True(singleSet.Set(), "Single not set is set!"); }
internal void Add_UpdateDicionaryAsExpected(SingleSet <string> target, string removed) { bool success; var expected = new HashSet <string>(target); bool result = expected.Add(removed); var res = target.Add(removed, out success); res.Should().BeEquivalentTo(expected); result.Should().Be(success); }
internal void IEnumerable_GetEnumerator_ReturnCorrectCollection(SingleSet <string> target) { System.Collections.IEnumerable nonetype = target; var enumerator = nonetype.GetEnumerator(); var secondenumerator = target.GetEnumerator(); while (enumerator.MoveNext() && secondenumerator.MoveNext()) { enumerator.Current.Should().Be(secondenumerator.Current); } }
internal void Add_ReturnNewInstanceIfSuccessfull(SingleSet <string> target, string removed) { bool success; var res = target.Add(removed, out success); if (res.Count == 2) { res.Should().BeOfType <ListSet <String> >(); } else { res.Should().BeSameAs(target); } }
/// <summary> /// Submits edited enumeration /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Submit_Click_New(object sender, EventArgs e) { this.enumeration.RemoveSetValues(); ArrayList tempList = new ArrayList(); foreach (object item in ListBoxExistingValues.Items) { tempList.Add(item); } SingleSet newSet = new SingleSet(tempList); this.enumeration.AddSingleSet(newSet); this.datalist.RemoveCategory(this.index); this.enumeration.Name = this.TextBoxNewName.Text; this.datalist.AddNewCategoryDirect(this.enumeration); this.Dispose(); }
public void Constructor_WithArgument_ShouldCreateCorrectEnumerable(string value) { var target = new SingleSet <string>(null, value); target.Should().BeEquivalentTo(new object[] { value }); }
public void Count_WithOneElement_Is1() { var target = new SingleSet <string>(null, ""); target.Count.Should().Be(1); }
public SingleSetTest() { _SingleSetSet = new SingleSet <string>(null); }