public void DCountryWithSqlShortName_WhenScrubbed_BecomesSafe() { string malicious = "<div>Hello, world!</div>');DROP TABLE dbo.Users;--"; DCountry country = new DCountry { Short_Name = malicious }; country.Scrub(); Assert.AreNotEqual(country.Short_Name, malicious); }
public void DCountryWithHtmlAndSqlShortName_WhenScrubbed_BecomesSafe() { string malicious = "attribute');DROP TABLE dbo.Users;--"; DCountry country = new DCountry { Short_Name = malicious }; country.Scrub(); Assert.AreNotEqual(country.Short_Name, malicious); }
public void DCountryWithHtmlLongName_WhenScrubbed_BecomesSafe() { string malicious = "<div>Hello, world!</div>"; DCountry country = new DCountry { Long_Name = malicious }; country.Scrub(); Assert.AreNotEqual(country.Long_Name, malicious); }
public IEnumerable<DCountry> Country_Update(DCountry updating) { IDataRepository<DCountry> countries = RepositoryFactory.Instance.Construct<DCountry>(); countries.Update(updating); return countries; }
public IEnumerable<DCountry> Country_Delete(DCountry deleting) { IDataRepository<DCountry> countries = RepositoryFactory.Instance.Construct<DCountry>(); countries.Delete(deleting); return countries; }
public void DCountry_WhenComparedAgainstDCountryWithSameKey_IsEquivilant() { int key = 1; DCountry first = new DCountry { key = key }; DCountry second = new DCountry { key = key }; bool equal = first.Equivilant(second); Assert.AreEqual(true, equal); }
public void DCountry_WhenAskedForKey_ReturnsCountryID() { DCountry country = new DCountry { Country_ID = -1 }; int key = country.key; Assert.AreEqual(key, country.Country_ID); }
//Parameterless constructor required for databinding. public DAddress() { country = new DCountry(); state = new DState(); }
public ActionResult Country_Update(DCountry updating) { return View(); }
public ActionResult Country_Delete(DCountry deleting) { return View(); }
public ActionResult Country_Create(DCountry creating) { return View(); }
public JsonResult State_GetByCountry(DCountry country) { var states = country.Country_ID == 0? phonebookService.State_GetList() : phonebookService.State_GetByCountry(country); return Json(states); }