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)); }
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); }
public void DImageWithHtmlTitle_WhenScrubbed_BecomesSafe() { string malicious = "<div>Hello, world!</div>"; DImage image = new DImage { Title = malicious }; image.Scrub(); Assert.AreNotEqual(image.Title, malicious); }
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); }
public IEnumerable<PImage> Image_Update(DImage updating, string username) { IDataRepository<DImage> images = RepositoryFactory.Instance.Construct<DImage>(username); images.Update(updating); return images; }
public void DImage_WhenAskedForKey_ReturnsCountryID() { DImage image = new DImage { Image_ID = -1 }; int key = image.key; Assert.AreEqual(key, image.Image_ID); }
public void Image_Update(DImage updating) { drawingService.Image_Update(updating, User.Identity.Name); }
public void Image_Delete(DImage deleting) { drawingService.Image_Delete(deleting, User.Identity.Name); }
public void Image_Create(DImage creating) { drawingService.Image_Create(creating, User.Identity.Name); }