Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 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;
        }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 public void DCountry_WhenAskedForKey_ReturnsCountryID()
 {
     DCountry country = new DCountry { Country_ID = -1 };
     int key = country.key;
     Assert.AreEqual(key, country.Country_ID);
 }
Beispiel #8
0
 //Parameterless constructor required for databinding.
 public DAddress()
 {
     country = new DCountry();
     state = new DState();
 }
Beispiel #9
0
 public ActionResult Country_Update(DCountry updating)
 {
     return View();
 }
Beispiel #10
0
 public ActionResult Country_Delete(DCountry deleting)
 {
     return View();
 }
Beispiel #11
0
 public ActionResult Country_Create(DCountry creating)
 {
     return View();
 }
Beispiel #12
0
 public JsonResult State_GetByCountry(DCountry country)
 {
     var states = country.Country_ID == 0?
         phonebookService.State_GetList() :
         phonebookService.State_GetByCountry(country);
     return Json(states);
 }