Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
        public IEnumerable<DPlace> Place_Update(DPlace updating)
        {
            IDataRepository<DPlace> places =
                RepositoryFactory.Instance.Construct<DPlace>();
            places.Update(updating);

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

            return places;
        }
Ejemplo n.º 6
0
 public ActionResult Place_Update(DPlace updating)
 {
     return View();
 }
Ejemplo n.º 7
0
 public ActionResult Place_Delete(DPlace deleting)
 {
     return View();
 }
Ejemplo n.º 8
0
 public ActionResult Place_Create(DPlace creating)
 {
     return View();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 10
0
 public void DPlace_WhenAskedForKey_ReturnsCountryID()
 {
     DPlace place = new DPlace { Place_ID = -1 };
     int key = place.key;
     Assert.AreEqual(key, place.Place_ID);
 }