public void Push_WhenNewElement_ThenAdded() { // given int element = 46; // when testObject.Push(element); // then testObject.Should().HaveCount(numbers.Length + 1); testObject.GetMin().Should().Be(minimum); testObject.GetMax().Should().Be(maximum); }
public void GetMax_WhenEmpty_ThenInvalidOperationException() { // given testObject = new DoubleHeap <int>(); // when Action action = () => testObject.GetMax(); // then action.Should().Throw <InvalidOperationException>(); }
public void GetMax_WhenSingleElement_ThenThisElement() { // given int element = 19; testObject = new DoubleHeap <int>(new[] { element }); // when int result = testObject.GetMax(); // then result.Should().Be(element); }
public void Push_WhenEmpty_ThenAdded() { // given int element = 19; testObject = new DoubleHeap <int>(); // when testObject.Push(element); // then testObject.Should().HaveCount(1); testObject.GetMin().Should().Be(element); testObject.GetMax().Should().Be(element); }