public void UpdateBinding_with_values_saves_all_data_correctly() { Binding binding = new AnonymousBindingBuilder().build(); Console.WriteLine("Binding.Id = {0}", binding.Id); //save the binding to the webshop string result = WebMethods.BindingMethods.UpdateBinding(binding); result = XElement.Parse(result).Value; Assert.IsTrue(result == "ok", string.Format("Binding with id {0} could not be created/updated. Unexpected return value was: {1}", binding.Id, result)); //retrieve the binding from the webshop string errorMsg; Binding bindingFromWS = WebMethods.BindingMethods.GetBindingById(binding.Id, out errorMsg); //compare all values Assert.AreEqual(binding.Id, bindingFromWS.Id, "The field comparison for field \"id\" failed."); Assert.AreEqual(binding.Name_NL, bindingFromWS.Name_NL, "The field comparison for field \"name_nl\" failed."); Assert.AreEqual(binding.Test, bindingFromWS.Test, "The field comparison for field \"test\" failed."); Assert.AreEqual(binding.CreatedDttm, bindingFromWS.CreatedDttm, "The field comparison for field \"created\" failed."); Assert.AreEqual(binding.UpdatedDttm, bindingFromWS.UpdatedDttm, "The field comparison for field \"updated\" failed."); Assert.AreEqual(binding.DeletedDttm, bindingFromWS.DeletedDttm, "The field comparison for field \"deleted\" failed."); }
public void UpdateBinding_creates_new_binding_and_returns_ok() { Binding binding = new AnonymousBindingBuilder().build(); string result = WebMethods.BindingMethods.UpdateBinding(binding); result = XElement.Parse(result).Value; Assert.IsTrue(result == "ok", string.Format("Binding with id {0} could not be created/updated. Unexpected return value: {1}", binding.Id, result)); }