public void Cleanup() { SupplierLoginManager myMan = new SupplierLoginManager(); ItemListingAccessor.DeleteItemListingTestItem(itemListingToTest); testSupp.SupplierID = modSupp.SupplierID; testLog = myMan.RetrieveSupplierLogin("Password#1", "Test"); TestCleanupAccessor.DeleteTestSupplierLogin(testLog); TestCleanupAccessor.DeleteTestSupplier(testSupp); }
public void EditSupplierworkingTest() // ☑ { Setup("EditSupWorking"); SupplierMang.AddANewSupplier(testSupplier, "Test"); SupplierLoginManager newMan = new SupplierLoginManager(); findTestItemDetails(); Supplier testSupplier2 = test2(); Assert.AreEqual(SupplierMang.EditSupplier(testSupplier, testSupplier2), SupplierResult.Success); testLog = newMan.RetrieveSupplierLogin("Password#1", "Test"); TestCleanupAccessor.DeleteTestSupplierLogin(testLog); TestCleanupAccessor.DeleteTestSupplier(testSupplier); }
/// <summary> /// Matt Lapka /// Created 2015/04/10 /// Sets login information based on session data /// <param name="sender"></param> /// <param name="e"></param> protected void CheckLogin(object sender, EventArgs e) { try { var user = _myMan.RetrieveSupplierLogin(txtPassword.Text, txtUserName.Text); var supplier = _mySuppMan.RetrieveSupplier(user.SupplierID); Session["user"] = supplier; Session["loggedIn"] = true; Session["login"] = user; lblError.Text = ""; } catch { Label errorLabel = (Label)Master.FindControl("lblErrorMessage"); errorLabel.Text = "Authentication Error. Please try again."; Control c = Master.FindControl("ErrorMess"); c.Visible = true; return; } //if validated send to supplier portal page Response.Redirect("~/portal"); }
public void TestSupplierLoginManageGet() { setup(); retrieveSupplier = access.RetrieveSupplierLogin("Password#1", "Test"); Assert.AreEqual("Test", retrieveSupplier.UserName); }