public void CreateAccountWebsiteAccrossAccounts() { ManagedAccount a = new ManagedAccount(Session); ManagedAccount b = new ManagedAccount(Session); try { a.Create("Test User", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext); b.Create("Test User 2", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext); TransitAccountWebsite ta = new TransitAccountWebsite(); ta.Name = "My Website"; ta.Description = "Lots of details."; ta.Url = "http://www.dblock.org"; ManagedAccountWebsite m_a = new ManagedAccountWebsite(Session); m_a.CreateOrUpdate(ta, a.GetSecurityContext()); ManagedAccountWebsite m_b = new ManagedAccountWebsite(Session); m_b.CreateOrUpdate(ta, b.GetSecurityContext()); } finally { a.Delete(a.GetSecurityContext()); b.Delete(b.GetSecurityContext()); } }
public void CreateAccountWebsiteInvalid() { ManagedAccount a = new ManagedAccount(Session); try { a.Create("Test User", "testpassword", "*****@*****.**", DateTime.UtcNow, AdminSecurityContext); TransitAccountWebsite ta = new TransitAccountWebsite(); ta.Name = "My Website"; ta.Description = "Lots of details."; ta.Url = "<script>attack!</script>"; ManagedAccountWebsite m_w = new ManagedAccountWebsite(Session); m_w.CreateOrUpdate(ta, a.GetSecurityContext()); } finally { a.Delete(AdminSecurityContext); } }