public void UpdateMethodOK() { clsSessionCollection AllSession = new clsSessionCollection(); clsSession TestItem = new clsSession(); Int32 PrimaryKey = 0; TestItem.EquipmentRequired = true; TestItem.TrainerID = 4; TestItem.BranchID = 3; TestItem.SessionType = "update Method"; TestItem.DateTime = DateTime.Now.Date; TestItem.Cost = 5; AllSession.ThisSession = TestItem; PrimaryKey = AllSession.Add(); TestItem.SessionID = PrimaryKey; TestItem.EquipmentRequired = false; TestItem.TrainerID = 2; TestItem.BranchID = 6; TestItem.SessionType = "update Method"; TestItem.DateTime = DateTime.Now.Date; TestItem.Cost = 3; AllSession.ThisSession = TestItem; PrimaryKey = AllSession.Update(); AllSession.ThisSession.Find(PrimaryKey); Assert.AreEqual(AllSession.ThisSession, TestItem); }
public void DateTimePropertyOK() { clsSession ASession = new clsSession(); DateTime TestData = DateTime.Now.Date; ASession.DateTime = TestData; Assert.AreEqual(ASession.DateTime, TestData); }
public void EquipmentRequiredPropertyOK() { clsSession ASession = new clsSession(); Boolean TestData = true; ASession.EquipmentRequired = TestData; Assert.AreEqual(ASession.EquipmentRequired, TestData); }
public void ValidMethodOK() { clsSession ASession = new clsSession(); String Error = ""; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreEqual(Error, ""); }
public void TrainerIDPropertyOK() { clsSession ASession = new clsSession(); int TestData = 3; ASession.TrainerID = TestData; Assert.AreEqual(ASession.TrainerID, TestData); }
public void BranchIDPropertyOK() { clsSession ASession = new clsSession(); int TestData = 2; ASession.BranchID = TestData; Assert.AreEqual(ASession.BranchID, TestData); }
public void TypePropertyOK() { clsSession ASession = new clsSession(); string TestData = "Swimming"; ASession.SessionType = TestData; Assert.AreEqual(ASession.SessionType, TestData); }
public void SessionIDPropertyOK() { clsSession ASession = new clsSession(); int TestData = 4; ASession.SessionID = TestData; Assert.AreEqual(ASession.SessionID, TestData); }
public void CostPropertyOK() { clsSession ASession = new clsSession(); Decimal TestData = 0; ASession.Cost = TestData; Assert.AreEqual(ASession.Cost, TestData); }
public void FindMethodOK() { clsSession ASession = new clsSession(); Boolean Found = false; Int32 SessionID = 4; Found = ASession.Find(SessionID); Assert.IsTrue(Found); }
public void BranchIDMid() { clsSession ASession = new clsSession(); String Error = ""; string branchID = "aaa"; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreEqual(Error, ""); }
public void TrianerIDMinLessOne() { clsSession ASession = new clsSession(); string Error = ""; string trainerID = ""; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreNotEqual(Error, ""); }
public void DateTimeInvalidData() { clsSession ASession = new clsSession(); String Error = ""; String dateTime = "this is not a date!"; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreNotEqual(Error, ""); }
public void CostMaxPlusOne() { clsSession ASession = new clsSession(); String Error = ""; string cost = "aaaaaaa"; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreNotEqual(Error, ""); }
public void CostExtremeMax() { clsSession ASession = new clsSession(); String Error = ""; String Cost = ""; cost = Cost.PadRight(10, 'a') + ""; Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreNotEqual(Error, ""); }
public void SessionsTypeMid() { clsSession ASession = new clsSession(); String Error = ""; string Type = ""; Type = Type.PadRight(25, 'a'); Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreEqual(Error, ""); }
public void DateTimeMin() { clsSession ASession = new clsSession(); String Error = ""; DateTime TestDate; TestDate = DateTime.Now.Date; string DateAdded = TestDate.ToString(); Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreEqual(Error, ""); }
public void DateTimeMinLessOne() { clsSession ASession = new clsSession(); String Error = ""; DateTime TestDate; TestDate = DateTime.Now.Date; TestDate = TestDate.AddDays(-1); string dateTime = TestDate.ToString(); Error = ASession.Valid(trainerID, branchID, sessionType, dateTime, cost); Assert.AreNotEqual(Error, ""); }
public void TestCostFound() { clsSession ASession = new clsSession(); Boolean Found = false; Boolean OK = true; Int32 SessionID = 4; Found = ASession.Find(SessionID); if (ASession.Cost != Convert.ToDecimal(3)) { OK = false; } Assert.IsTrue(OK); }
public void TestDateTimeFound() { clsSession ASession = new clsSession(); Boolean Found = false; Boolean OK = true; Int32 SessionID = 4; Found = ASession.Find(SessionID); if (ASession.DateTime != Convert.ToDateTime("03/05/2020 00:00:00")) { OK = false; } Assert.IsTrue(OK); }
public void TestEquipmenRequiedFound() { clsSession ASession = new clsSession(); Boolean Found = false; Boolean OK = true; Int32 SessionID = 4; Found = ASession.Find(SessionID); if (ASession.EquipmentRequired != false) { OK = false; } Assert.IsTrue(OK); }
public void TestSessionTypeFound() { clsSession ASession = new clsSession(); Boolean Found = false; Boolean OK = true; Int32 SessionID = 4; Found = ASession.Find(SessionID); if (ASession.SessionType != "Swimming") { OK = false; } Assert.IsTrue(OK); }
public void TestBranchIDFound() { clsSession ASession = new clsSession(); Boolean Found = false; Boolean OK = true; Int32 SessionID = 4; Found = ASession.Find(SessionID); if (ASession.BranchID != 2) { OK = false; } Assert.IsTrue(OK); }
public void ThisSessionPropertyOK() { clsSessionCollection AllSession = new clsSessionCollection(); clsSession TestSession = new clsSession(); TestSession.EquipmentRequired = false; TestSession.SessionID = 1; TestSession.SessionType = "Some Type"; TestSession.DateTime = DateTime.Now.Date; TestSession.TrainerID = 4; TestSession.BranchID = 3; TestSession.Cost = 5; AllSession.ThisSession = TestSession; Assert.AreEqual(AllSession.ThisSession, TestSession); }
public void ListandCountOK() { clsSessionCollection AllSession = new clsSessionCollection(); List <clsSession> TestList = new List <clsSession>(); clsSession TestItem = new clsSession(); TestItem.EquipmentRequired = false; TestItem.SessionID = 1; TestItem.SessionType = "Some Type"; TestItem.DateTime = DateTime.Now.Date; TestItem.TrainerID = 4; TestItem.BranchID = 3; TestItem.Cost = 5; TestList.Add(TestItem); AllSession.SessionList = TestList; Assert.AreEqual(AllSession.Count, TestList.Count); }
public void AddMethodOK() { clsSessionCollection AllSession = new clsSessionCollection(); clsSession TestItem = new clsSession(); Int32 PrimaryKey = 0; TestItem.EquipmentRequired = true; TestItem.TrainerID = 1; TestItem.BranchID = 1; TestItem.SessionID = 2; TestItem.SessionType = "Add Method"; TestItem.DateTime = DateTime.Now.Date; TestItem.Cost = 5; AllSession.ThisSession = TestItem; PrimaryKey = AllSession.Add(); //set the primary key of the test data TestItem.SessionID = PrimaryKey; //find the record AllSession.ThisSession.Find(PrimaryKey); //test to see that the two values are the same Assert.AreEqual(AllSession.ThisSession, TestItem); }
public void DeleteMethodOK() { clsSessionCollection AllSession = new clsSessionCollection(); clsSession TestItem = new clsSession(); Int32 PrimaryKey = 0; TestItem.EquipmentRequired = true; TestItem.TrainerID = 4; TestItem.BranchID = 3; TestItem.SessionID = 51; TestItem.SessionType = "Delete Method"; TestItem.DateTime = DateTime.Now.Date; TestItem.Cost = 5; AllSession.ThisSession = TestItem; PrimaryKey = AllSession.Add(); TestItem.SessionID = PrimaryKey; AllSession.ThisSession.Find(PrimaryKey); AllSession.Delete(); Boolean Found = AllSession.ThisSession.Find(PrimaryKey); Assert.IsFalse(Found); }
public void InstanceOK() { clsSession ASession = new clsSession(); Assert.IsNotNull(ASession); }