public void Cannot_Set_Administrator_Without_CustomerID() { var webshipaccount = new WebshipAccount(); TestDelegate del = () => { webshipaccount.Administrator = true; }; Assert.Throws(typeof(CustomerIDRequiredException), del); }
public void Class_Change_Tracking_Interface_Works() { var webshipaccount = new WebshipAccount(); webshipaccount.AcceptChanges(); Assert.AreEqual(false, webshipaccount.IsChanged); webshipaccount.LoginName = "Food"; Assert.AreEqual(true, webshipaccount.IsChanged); }
public void Cannot_Set_Administrator_Unless_CustomerID_Is_Privileged() { var webshipaccount = new WebshipAccount(); webshipaccount.CustID = 1000; TestDelegate del = () => { webshipaccount.Administrator = true; }; Assert.Throws(typeof(PrivilegedCustomerIDRequiredException), del); }
public void Administrator_Get_Set_Property_Works() { var webshipaccount = new WebshipAccount(); // Only account 1 is privileged at this time webshipaccount.CustID = 1; webshipaccount.Administrator = true; Assert.AreEqual(true, webshipaccount.Administrator); webshipaccount.Administrator = false; Assert.AreEqual(false, webshipaccount.Administrator); }
public void Setting_Class_Properties_Raises_Event() { var webshipaccount = new WebshipAccount(); bool eventRaised = false; webshipaccount.PropertyChanged += delegate(object sender, System.ComponentModel.PropertyChangedEventArgs e) { eventRaised = true; Assert.AreEqual("LoginName", e.PropertyName); }; webshipaccount.LoginName = "Cooter"; Assert.AreEqual(true, eventRaised); }
public void Can_Add_WebshipAccount_Objects_To_Repository() { var newaccount = new WebshipAccount(); newaccount.LoginName = "SillyTest"; newaccount.UserFirstName = "Silly"; newaccount.UserLastName = "Test"; newaccount.UserEmail = "*****@*****.**"; newaccount.IsUserAdmin = false; newaccount.CustID = 1; _repository.Add(newaccount); var accountsearch = _repository.GetAllWithLoginNameCustId("SillyTest", 1); Assert.AreEqual(1, accountsearch.Count); }
public void InitTests() { _testprofile = new UserProfile(); _testprofile.CustID = 1; _testprofile.ABEntryToday = 10; _testprofile.AccountLockout = false; _testprofile.Active = true; _testprofile.Administrator = true; _testprofile.BillingRefRequired = false; _testprofile.CompanyAddress1 = "123 Any St."; _testprofile.CompanyAddress2 = "Suite 100"; _testprofile.CompanyName = "LSO"; _testprofile.CompanyCity = "Austin"; _testprofile.LoginName = "testlogin"; _testprofile.UserFirstName = "Blah"; _testprofile.UserLastName = "Brand"; _testprofile.UserEmail = "*****@*****.**"; _testprofile.LastLoginDate = new DateTime(2010, 10, 11); _testprofile.IsUserAdmin = true; _testwebshipaccount = new WebshipAccount(); _testwebshipaccount.CustID = 1; _testwebshipaccount.ABEntryToday = 10; _testwebshipaccount.AccountLockout = false; _testwebshipaccount.Active = true; _testwebshipaccount.Administrator = true; _testwebshipaccount.BillingRefRequired = false; _testwebshipaccount.CompanyAddress1 = "123 Any St."; _testwebshipaccount.CompanyAddress2 = "Suite 100"; _testwebshipaccount.CompanyName = "LSO"; _testwebshipaccount.CompanyCity = "Austin"; _testwebshipaccount.LoginName = "testlogin"; _testwebshipaccount.UserFirstName = "Blah"; _testwebshipaccount.UserLastName = "Brand"; _testwebshipaccount.UserEmail = "*****@*****.**"; _testwebshipaccount.LastLoginDate = new DateTime(2010, 10, 11); _testwebshipaccount.IsUserAdmin = true; }