示例#1
0
 public void DEmailWithSqlUrl_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>');DROP TABLE dbo.Users;--";
     DEmail email = new DEmail { Url = malicious };
     email.Scrub();
     Assert.AreNotEqual(email.Url, malicious);
 }
示例#2
0
 public void DEmailWithHtmlUrl_WhenScrubbed_BecomesSafe()
 {
     string malicious = "<div>Hello, world!</div>";
     DEmail email = new DEmail { Url = malicious };
     email.Scrub();
     Assert.AreNotEqual(email.Url, malicious);
 }
示例#3
0
 public void DEmailWithHtmlAndSqlUrl_WhenScrubbed_BecomesSafe()
 {
     string malicious = "attribute');DROP TABLE dbo.Users;--";
     DEmail email = new DEmail { Url = malicious };
     email.Scrub();
     Assert.AreNotEqual(email.Url, malicious);
 }
示例#4
0
 public void DEmail_WhenComparedAgainstDEmailWithSameKey_IsEquivilant()
 {
     int key = 1;
     DEmail first = new DEmail { key = key, Url = "First" };
     DEmail second = new DEmail { key = key, Url = "Second" };
     bool equal = first.Equivilant(second);
     Assert.AreEqual(true, equal);
 }
        public IEnumerable<DContact> Email_Update(DEmail updating, string username)
        {
            IDataRepository<DContact> contacts =
                RepositoryFactory.Instance.Construct<DContact>(username);
            IDataRepository<DEmail> emails;
            if ((emails = contacts.FirstOrDefault(x => x.Contact_ID == updating.Contact_ID)
                    .emails as IDataRepository<DEmail>) != null){
                emails.Update(updating);
            }

            return contacts;
        }
示例#6
0
 public ActionResult Email_Update(DEmail updating)
 {
     return View();
 }
示例#7
0
 public ActionResult Email_Delete(DEmail deleting)
 {
     return View();
 }
示例#8
0
 public ActionResult Email_Create(DEmail creating)
 {
     return View();
 }
示例#9
0
 public void DEmail_WhenAskedForKey_ReturnsCountryID()
 {
     DEmail email = new DEmail { Email_ID = -1 };
     int key = email.key;
     Assert.AreEqual(key, email.Email_ID);
 }