예제 #1
0
        public static void ModifiedClone_Dictionary_ShouldNotBeEqual()
        {
            var original = new DictionaryObject
            {
                Collection =
                {
                    { 1, new BasicObject()
                        {
                            IntValue = 1, LongValue = 10
                        } },
                    { 2, new BasicObject()
                        {
                            IntValue = 2, LongValue = 20
                        } },
                    { 3, new BasicObject()
                        {
                            IntValue = 3, LongValue = 30
                        } },
                }
            };
            DictionaryObject cloned = original.Clone();

            cloned.Collection[2].LongValue = 200;

            cloned.ShouldNotBe(original);
        }