예제 #1
0
        public void CloneObject()
        {
            MerchantReference merchantReference = new MerchantReference();

            merchantReference.Name        = "Configuração";
            merchantReference.MerchantKey = Guid.NewGuid();

            merchantReference.ReportCollection.Add(new Report()
            {
                Field = "Teste", Message = "Conteúdo"
            });
            merchantReference.ReportCollection.Add(new Report()
            {
                Field = "Outro teste", Message = "Outro conteúdo"
            });

            MerchantReference clonedMerchantReference = merchantReference.Clone();

            Assert.IsNotNull(clonedMerchantReference);

            Assert.AreEqual(clonedMerchantReference.Name, merchantReference.Name);

            clonedMerchantReference.Name = "Edição";

            Assert.AreNotEqual(clonedMerchantReference.Name, merchantReference.Name);
        }
예제 #2
0
        public void CloneNullObject()
        {
            MerchantReference actual = ObjectExtensions.Clone <MerchantReference>(null);

            Assert.IsNull(actual);
        }