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