Beispiel #1
0
        public override bool Equals(System.Object otherSpecies)
        {
            if (!(otherSpecies is Species))
            {
                return(false);
            }
            else
            {
                Species newSpecies   = (Species)otherSpecies;
                bool    idEquality   = (this.GetSpeciesId() == newSpecies.GetSpeciesId());
                bool    typeEquality = (this.GetType() == newSpecies.GetType());

                return(idEquality && typeEquality);
            }
        }
Beispiel #2
0
        public void Test_Update_UpdatesSpeciesInDatabase()
        {
            //Arrange
            string  testType    = "Cat";
            Species testSpecies = new Species(testType);

            testSpecies.Save();
            string newType = "Mouse";

            //Act
            testSpecies.Update(newType);

            string result = testSpecies.GetType();

            //Assert
            Assert.Equal(newType, result);
        }