예제 #1
0
 public void DImage_WhenComparedAgainstDImageWithSameKey_IsEquivilant()
 {
     int key = 1;
     DImage first = new DImage { key = key };
     DImage second = new DImage { key = key };
     Assert.IsTrue(first.Equivilant(second));
 }
예제 #2
0
 public void DImageWithSqlUsername_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>');DROP TABLE dbo.Users;--";
     DImage image = new DImage { username = malicious };
     image.Scrub();
     Assert.AreNotEqual(image.username, malicious);
 }
예제 #3
0
 public void DImageWithHtmlTitle_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>";
     DImage image = new DImage { Title = malicious };
     image.Scrub();
     Assert.AreNotEqual(image.Title, malicious);
 }
예제 #4
0
 public void DImageWithHtmlAndSqlUsername_WhenScrubbed_BecomesSafe()
 {
     string malicious = "attribute');DROP TABLE dbo.Users;--";
     DImage image = new DImage { username = malicious };
     image.Scrub();
     Assert.AreNotEqual(image.username, malicious);
 }
예제 #5
0
        public IEnumerable<PImage> Image_Update(DImage updating, string username)
        {
            IDataRepository<DImage> images =
                RepositoryFactory.Instance.Construct<DImage>(username);
            images.Update(updating);

            return images;
        }
예제 #6
0
 public void DImage_WhenAskedForKey_ReturnsCountryID()
 {
     DImage image = new DImage { Image_ID = -1 };
     int key = image.key;
     Assert.AreEqual(key, image.Image_ID);
 }
예제 #7
0
 public void Image_Update(DImage updating)
 {
     drawingService.Image_Update(updating, User.Identity.Name);
 }
예제 #8
0
 public void Image_Delete(DImage deleting)
 {
     drawingService.Image_Delete(deleting, User.Identity.Name);
 }
예제 #9
0
 public void Image_Create(DImage creating)
 {
     drawingService.Image_Create(creating, User.Identity.Name);
 }