Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static void Should_Clone_DictionaryObject()
        {
            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.ShouldBe(original);
        }
Exemplo n.º 3
0
        public void Should_Clone_DictionaryObject()
        {
            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
                        } },
                }
            };
            var cloned = original.Clone();

            Assert.AreEqual(original, cloned);
        }