Exemple #1
0
 public override bool Equals(System.Object otherPatron)
 {
     if (!(otherPatron is Patron))
     {
         return(false);
     }
     else
     {
         Patron newPatron    = (Patron)otherPatron;
         bool   nameEquality = (this.GetName() == newPatron.GetName());
         return(nameEquality);
     }
 }
Exemple #2
0
        public void T6_Update_UpdatesPatronInDB()
        {
            Patron testPatron = new Patron("Judy");

            testPatron.Save();

            string newName = "Barb";

            testPatron.Update(newName);

            string resultName = testPatron.GetName();

            Assert.Equal(newName, resultName);
        }
Exemple #3
0
        public void Update_UpdatesPatronName_Name()
        {
            Patron newPatron = new Patron("Joe");

            newPatron.Save();

            string newPatronName = "John";

            newPatron.Update(newPatronName);

            string actual = newPatron.GetName();

            Assert.Equal(newPatronName, actual);
        }
Exemple #4
0
 public override bool Equals(System.Object otherPatron)
 {
     if (!(otherPatron is Patron))
     {
         return(false);
     }
     else
     {
         Patron newPatron    = (Patron)otherPatron;
         bool   idEquality   = this.GetId() == newPatron.GetId();
         bool   nameEquality = this.GetName() == newPatron.GetName();
         bool   numEquality  = this.GetPhone() == newPatron.GetPhone();
         return(idEquality && nameEquality && numEquality);
     }
 }
Exemple #5
0
        public void UpdateName_OnePatron_NewName()
        {
            Patron patron1 = new Patron("Barcelona");

            patron1.Save();
            Patron patron2 = new Patron("Honolulu");

            patron2.Save();

            patron1.UpdateName("ex patron");

            string newName = patron1.GetName();

            Assert.Equal(newName, "ex patron");
        }
Exemple #6
0
        public void Search_PatronTitle_FoundPatronInDatabase()
        {
            //Arrange
            Patron testPatron1 = new Patron("example patron1");

            testPatron1.Save();

            Patron testPatron2 = new Patron("example patron2");

            testPatron2.Save();

            //Act
            Patron result = Patron.Search(testPatron2.GetName());

            //Assert
            Assert.Equal(testPatron2, result);
        }
Exemple #7
0
        public void T6_Update_UpdatesPatronInDB()
        {
            Patron testPatron = new Patron("Judy");
              testPatron.Save();

              string newName = "Barb";

              testPatron.Update(newName);

              string resultName = testPatron.GetName();

              Assert.Equal(newName, resultName);
        }