public void Remove_CheckRemoveOfElementsFromEmptyArray_ReturnFalse(int value) { //arrange var arr = new DynamicSortedArray <int>(); //act & assert Assert.False(arr.Remove(value)); }
public void Remove_CheckRemoveOfElementsThatAreNotInArray_ReturnFalse(int value) { //arrange var arr = new DynamicSortedArray <int> { 3, 1, 5, 8, 1, 6 }; //act & assert Assert.False(arr.Remove(value)); }
public void Remove_CheckRemoveOfElementsThatAreInCollection_ReturnTrue(int value) { //arrange var arr = new DynamicSortedArray <int> { 3, 1, 5, 8, 1, 6 }; //act & assert Assert.True(arr.Remove(value)); }
public void Remove_CheckThatEventRaisedWhenDeletingElementFromArray_ReturnNothing() { //arrange var arr = new DynamicSortedArray <int> { 2, 2, 5, 8, 1, 6 }; var itemToRemove = 1; //act var receivedEvent = Assert.Raises <RemoveFromArrayEventArgs <int> >( a => arr.Removed += a, a => arr.Removed -= a, () => { arr.Remove(itemToRemove); }); //assert Assert.NotNull(receivedEvent); Assert.Equal(itemToRemove, receivedEvent.Arguments.RemovedItem); Assert.Equal($"{itemToRemove} was removed", receivedEvent.Arguments.Message); }