Example #1
0
 public void DPlaceWithSqlShortName_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>');DROP TABLE dbo.Users;--";
     DPlace place = new DPlace { Short_Name = malicious };
     place.Scrub();
     Assert.AreNotEqual(place.Short_Name, malicious);
 }
Example #2
0
 public void DPlaceWithHtmlLongName_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>";
     DPlace place = new DPlace { Long_Name = malicious };
     place.Scrub();
     Assert.AreNotEqual(place.Long_Name, malicious);
 }
Example #3
0
 public void DPlaceWithHtmlAndSqlShortName_WhenScrubbed_BecomesSafe()
 {
     string malicious = "attribute');DROP TABLE dbo.Users;--";
     DPlace place = new DPlace { Short_Name = malicious };
     place.Scrub();
     Assert.AreNotEqual(place.Short_Name, malicious);
 }
        public IEnumerable<DPlace> Place_Update(DPlace updating)
        {
            IDataRepository<DPlace> places =
                RepositoryFactory.Instance.Construct<DPlace>();
            places.Update(updating);

            return places;
        }
        public IEnumerable<DPlace> Place_Delete(DPlace deleting)
        {
            IDataRepository<DPlace> places =
                RepositoryFactory.Instance.Construct<DPlace>();
            places.Delete(deleting);

            return places;
        }
Example #6
0
 public ActionResult Place_Update(DPlace updating)
 {
     return View();
 }
Example #7
0
 public ActionResult Place_Delete(DPlace deleting)
 {
     return View();
 }
Example #8
0
 public ActionResult Place_Create(DPlace creating)
 {
     return View();
 }
Example #9
0
 public void DPlace_WhenComparedAgainstDPlaceWithSameKey_IsEquivilant()
 {
     int key = 1;
     DPlace first = new DPlace { key = key };
     DPlace second = new DPlace { key = key };
     bool equal = first.Equivilant(second);
     Assert.AreEqual(true, equal);
 }
Example #10
0
 public void DPlace_WhenAskedForKey_ReturnsCountryID()
 {
     DPlace place = new DPlace { Place_ID = -1 };
     int key = place.key;
     Assert.AreEqual(key, place.Place_ID);
 }