public void ReduceShouldSimplifyDictionaryValuesWithSelector()
        {
            // arrange
            var target = new Dictionary<string, int>()
            {
                { "Key1", 1 },
                { "Key2", 2 },
                { "Key3", 3 },
                { "Key4", 4 },
                { "Key5", 5 }
            };

            // act
            // Key4 and Key5 are removed and Key9 is added
            var actual = target.Reduce( "Key4", "Key5", "Key9", ( v1, v2 ) => v1 + v2 );

            // assert
            Assert.Equal( 4, actual.Count );
            Assert.True( actual.ContainsKey( "Key1" ) );
            Assert.True( actual.ContainsKey( "Key2" ) );
            Assert.True( actual.ContainsKey( "Key3" ) );
            Assert.False( actual.ContainsKey( "Key4" ) );
            Assert.False( actual.ContainsKey( "Key5" ) );
            Assert.True( actual.ContainsKey( "Key9" ) );
            Assert.Equal( 9, actual["Key9"] );
        }
        public void ReduceShouldSimplifyDictionaryValues()
        {
            // arrange
            var target = new Dictionary<string, int>()
            {
                { "KeyA", 1 },
                { "KeyB", 2 },
                { "KeyC", 1 },
                { "KeyD", 2 },
                { "KeyE", 3 }
            };

            // act
            // KeyA and KeyC are removed and a new KeyA is added with value 1 (from the original KeyA)
            var actual = target.Reduce( "KeyA", "KeyC", "KeyA" );

            // assert
            Assert.Equal( 4, actual.Count );
            Assert.True( actual.ContainsKey( "KeyA" ) );
            Assert.True( actual.ContainsKey( "KeyB" ) );
            Assert.False( actual.ContainsKey( "KeyC" ) );
            Assert.True( actual.ContainsKey( "KeyD" ) );
            Assert.True( actual.ContainsKey( "KeyE" ) );
            Assert.Equal( 1, actual["KeyA"] );
        }