public void AddKeyed_TwoItemsWithTheSameKeys_WithOverwrite_OverwritesOldItem()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();


            // act
            sut.AddKeyed("a", "aaa");
            sut.AddKeyed("a", "bbb", overwrite: true);


            // assert
            sut.Should().Equal("bbb");
        }
        public void AddKeyed_TwoItemsWithTheSameKeys_ByDefault_DoesNotAddsNewItem()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();


            // act
            sut.AddKeyed("a", "aaa");
            sut.AddKeyed("a", "bbb");


            // assert
            sut.Should().Equal("aaa");
        }
        public void AddKeyed_TwoItemsWithDifferentKeys_AddsBothItems()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();


            // act
            sut.AddKeyed("a", "aaa");
            sut.AddKeyed("b", "bbb");


            // assert
            sut.Should().Equal("aaa", "bbb");
            sut["a"].Should().Be("aaa");
            sut["b"].Should().Be("bbb");
        }
        public void GetIndex_HasCorrespondingKeyedItem_ReturnsItsIndex()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();

            sut.AddKeyed("a", "aaa");

            // act
            var result = sut.GetIndex("a");


            // assert
            result.Should().Be(0);
        }
        public void GetCount_OneKeyedItem_ReturnsOne()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();

            sut.AddKeyed("a", "aaa");


            // act


            // assert
            sut.Count.Should().Be(1);
        }
        public void GetIndex_NoCorrespondingKeyedItem_ReturnsNull()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();

            sut.AddKeyed("a", "aaa");

            // act
            var result = sut.GetIndex("b");


            // assert
            result.Should().NotHaveValue();
        }
        public void AddKeyed_And_AddSequenced_AddsBothItems()
        {
            // arrange
            var sut = new OrderedHybridCollection <string, string> ();


            // act
            sut.AddKeyed("a", "aaa");
            sut.AddSequenced("bbb");


            // assert
            sut.Should().Equal("aaa", "bbb");
            sut["a"].Should().Be("aaa");
        }