public void TestClone() { var b = brand.Clone(); foreach (var property in b.GetType().GetProperties()) { Assert.AreEqual(property.GetValue(brand), property.GetValue(b)); } }
public string CreateBrand(Brand brand) { CheckHelper.ArgumentNotNull(brand, "brand"); CheckHelper.WithinCondition(SecurityService.IsLoggedIn, "SecurityService.IsLoggedIn"); var errors = IoC.Container.Get <IValidateService>().Validate(brand); if (errors != null) { return(errors.ToErrorMessage()); } var createdBrand = (Brand)brand.Clone(); var errorMessage = APIClientHelper <DictionaryAPIClient> .Call(c => c.CreateBrand(ref createdBrand)); brand.Id = createdBrand.Id; return(errorMessage); }