Exemplo n.º 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));
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 5
0
        public IEnumerable<PImage> Image_Update(DImage updating, string username)
        {
            IDataRepository<DImage> images =
                RepositoryFactory.Instance.Construct<DImage>(username);
            images.Update(updating);

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