public void ValidMethodOK() { ClsPosition position = new ClsPosition(); string error = ""; error = position.Valid(positioName, description, salary); Assert.AreEqual(error, ""); }
public void PositionNamePropertyOK() { ClsPosition position = new ClsPosition(); string testData = "Software Engineer"; position.PositionName = testData; Assert.AreEqual(position.PositionName, testData); }
public void DescriptionPropertyOK() { ClsPosition position = new ClsPosition(); string testData = "Develops software solutions"; position.Description = testData; Assert.AreEqual(position.Description, testData); }
public void PositionIDPropertyOK() { ClsPosition position = new ClsPosition(); int testData = 112; position.PositionID = testData; Assert.AreEqual(position.PositionID, testData); }
public void SalaryPropertyOK() { ClsPosition position = new ClsPosition(); decimal testData = 50000.00M; position.Salary = testData; Assert.AreEqual(position.Salary, testData); }
public void SalaryMinPlus1() { ClsPosition position = new ClsPosition(); string error = ""; string salary = "AA"; error = position.Valid(positioName, description, salary); Assert.AreEqual(error, ""); }
public void DescriptionMinLess1() { ClsPosition position = new ClsPosition(); string error = ""; string description = ""; error = position.Valid(positioName, description, salary); Assert.AreNotEqual(error, ""); }
public void PositionNameMin() { ClsPosition position = new ClsPosition(); string error = ""; string name = "A"; error = position.Valid(name, description, salary); Assert.AreEqual(error, ""); }
public void DescriptionMaxPlus1() { ClsPosition position = new ClsPosition(); string error = ""; string description = ""; description = description.PadRight(101, 'A'); error = position.Valid(positioName, description, salary); Assert.AreNotEqual(error, ""); }
public void PositionNameMaxExtreme() { ClsPosition position = new ClsPosition(); string error = ""; string name = ""; name = name.PadRight(500, 'A'); error = position.Valid(name, description, salary); Assert.AreNotEqual(error, ""); }
public void ThisPositionPropertyOK() { ClsPositionCollection allPosition = new ClsPositionCollection(); ClsPosition testPosition = new ClsPosition(); testPosition.PositionID = 1; testPosition.PositionName = "Software Engineer"; testPosition.Description = "Develop and deploy software."; testPosition.Salary = 35000.00M; allPosition.ThisPosition = testPosition; Assert.AreEqual(allPosition.ThisPosition, testPosition); }
public void SalaryMaxExtreme() { ClsPosition position = new ClsPosition(); string error = ""; string salary = ""; salary = salary.PadRight(500, 'A'); error = position.Valid(positioName, description, salary); Assert.AreNotEqual(error, ""); }
public void TestSalaryFound() { ClsPosition position = new ClsPosition(); bool Found = false; bool OK = true; int PositionID = 1; Found = position.Find(PositionID); if (position.Salary != 35000.00M) { OK = false; } Assert.IsTrue(OK); }
public void TestDescriptionFound() { ClsPosition position = new ClsPosition(); bool Found = false; bool OK = true; int positionID = 1; Found = position.Find(positionID); if (position.Description != "Develop and deploy software.") { OK = false; } Assert.IsTrue(OK); }
public void TestPositionNameFound() { ClsPosition position = new ClsPosition(); bool Found = false; bool OK = true; int PositionID = 1; Found = position.Find(PositionID); if (position.PositionName != "Software Engineer") { OK = false; } Assert.IsTrue(OK); }
public void ListAndCountOK() { ClsPositionCollection allPosition = new ClsPositionCollection(); List <ClsPosition> testList = new List <ClsPosition>(); ClsPosition testItem = new ClsPosition(); testItem.PositionID = 1; testItem.PositionName = "Software Engineer"; testItem.Description = "Develop and deploy software."; testItem.Salary = 35000.00M; testList.Add(testItem); allPosition.PositionList = testList; Assert.AreEqual(allPosition.Count, testList.Count); }
//[TestMethod] public void TestPositionIDFound() { ClsPosition position = new ClsPosition(); bool Found = false; bool OK = true; int PositionID = 1; Found = position.Find(PositionID); if (position.PositionID != 1) { OK = false; } Assert.IsTrue(OK); }
public void AddMethodOK() { ClsPositionCollection allPosition = new ClsPositionCollection(); ClsPosition testItem = new ClsPosition(); int primaryKey = 0; testItem.PositionID = 12; testItem.PositionName = "Web Designer"; testItem.Description = "Create the look, layout, and features of a website."; testItem.Salary = 40000.00M; allPosition.ThisPosition = testItem; primaryKey = allPosition.Add(); testItem.PositionID = primaryKey; Assert.AreEqual(allPosition.ThisPosition, testItem); }
protected void BtnFind_Click(object sender, EventArgs e) { ClsPosition position = new ClsPosition(); Int32 positionID; Boolean Found = false; if (System.Text.RegularExpressions.Regex.IsMatch(TbPositionID.Text, "^[a-zA-Z]*$")) { Response.Redirect("PositionPage.aspx"); } positionID = Convert.ToInt32(TbPositionID.Text); Found = position.Find(positionID); if (Found == true) { TbPositionName.Text = position.PositionName; TbDescription.Text = position.Description; TbSalary.Text = position.Salary.ToString(); } }
public void DeleteMethodOK() { ClsPositionCollection allPosition = new ClsPositionCollection(); ClsPosition testItem = new ClsPosition(); int primaryKey = 0; testItem.PositionID = 1; testItem.PositionName = "Software Engineer"; testItem.Description = "Develop and deploy software."; testItem.Salary = 35000.00M; allPosition.ThisPosition = testItem; primaryKey = allPosition.Add(); testItem.PositionID = primaryKey; allPosition.ThisPosition.Find(primaryKey); allPosition.Delete(); bool found = allPosition.ThisPosition.Find(primaryKey); Assert.IsFalse(found); }
protected void BtnSubmit_Click(object sender, EventArgs e) { ClsPosition position = new ClsPosition(); string positionName = TbPositionName.Text; string description = TbDescription.Text; string salary = TbSalary.Text; string error = ""; error = position.Valid(positionName, description, salary); if (error == "") { position.PositionID = positionID; position.PositionName = positionName; position.Description = description; position.Salary = Decimal.Parse(salary); ClsPositionCollection positionList = new ClsPositionCollection(); if (positionID == -1) { positionList.ThisPosition = position; positionList.Add(); } else { positionList.ThisPosition.Find(positionID); positionList.ThisPosition = position; positionList.Update(); } Response.Redirect("PositionList.aspx"); } else { LblError.Text = error; } }
public void UpdateMethodOK() { ClsPositionCollection allPosition = new ClsPositionCollection(); ClsPosition testItem = new ClsPosition(); int primaryKey = 0; testItem.PositionName = "Software Engineer"; testItem.Description = "Develop and deploy software."; testItem.Salary = 35000.00M; allPosition.ThisPosition = testItem; primaryKey = allPosition.Add(); testItem.PositionName = "Penetration Tester"; testItem.Description = ""; testItem.Salary = 50000.00M; allPosition.ThisPosition = testItem; allPosition.Update(); allPosition.ThisPosition.Find(primaryKey); Assert.AreEqual(allPosition.ThisPosition, testItem); }
public void InstanceOK() { ClsPosition position = new ClsPosition(); Assert.IsNotNull(position); }