Exemplo n.º 1
0
        public void DeletingByNonExistingScoreAndElement()
        {
            // Given
            var sortedSet = new SortedSet.SortedSet();

            sortedSet.Insert(1, "one");

            // When deleting a non-existing score and element
            var result = sortedSet.Delete(1, "two");

            // Then it should not delete
            result.Should().BeFalse();
            sortedSet.Length.Should().Be(1);
        }
Exemplo n.º 2
0
        public void DeletingByExistingScoreAndElement()
        {
            // Given
            var sortedSet = new SortedSet.SortedSet();

            sortedSet.Insert(1, "one");

            // When existing score and element are deleted
            var result = sortedSet.Delete(1, "one");

            // Then it should successfully delete
            result.Should().BeTrue();
            sortedSet.Length.Should().Be(0);
        }