/// <summary> /// Inserts Person to DB /// </summary> /// <exception cref="ArgumentException">Throw if object is null or not valid</exception> /// <param name="person">Person to insert</param> public void Insert(Model.Person person) { if (person != null && person.Validate()) { InsertPerson((Mock.PhoneBook.Person)person); InsertPhone((Mock.PhoneBook.Phone)person); InsertAddress((Mock.PhoneBook.Address)person); } else throw new ArgumentException("Object is not valid"); }
public void ModelSanityNotSafe() { Model = new Common.Swagger12.Model(false); Assert.IsNull(Model.Description); Assert.IsNotNull(Model.Properties); Assert.IsNull(Model.SubTypes); Assert.IsNull(Model.Required); Model.Validate(Violations); Assert.AreEqual(0, Violations.Count); }