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); }
public void CloneNullObject() { MerchantReference actual = ObjectExtensions.Clone <MerchantReference>(null); Assert.IsNull(actual); }