예제 #1
0
        public override bool Equals(System.Object otherClient)
        {
            if (!(otherClient is Client))
            {
                return(false);
            }
            else
            {
                Client newClient         = (Client)otherClient;
                bool   idEquality        = this.GetId() == newClient.GetId();
                bool   firstNameEquality = this.GetFirstName() == newClient.GetFirstName();
                bool   lastNameEquality  = this.GetLastName() == newClient.GetLastName();
                bool   stylistIdEquality = this.GetStylistId() == newClient.GetStylistId();

                return(idEquality && firstNameEquality && lastNameEquality && stylistIdEquality);
            }
        }
예제 #2
0
        public void T6_Update_UpdatesClientInDB()
        {
            Client testClient = new Client("Shaggy", "Dew", 1);

            testClient.Save();

            string newFirst     = "Lange";
            string newLast      = "Ponyta";
            int    newStylistId = 2;

            testClient.Update(newFirst, newLast, newStylistId);

            string result1 = testClient.GetFirstName();
            string result2 = testClient.GetLastName();
            int    result3 = testClient.GetStylistId();

            Assert.Equal(newFirst, result1);
            Assert.Equal(newLast, result2);
            Assert.Equal(newStylistId, result3);
        }