public void T5_Find_FindsPerformanceInDB()
        {
            DateTime performanceDate = new DateTime(2016, 08, 04);

            Performance testPerformance = new Performance(1, 2, performanceDate);

            testPerformance.Save();

            Performance foundPerformance = Performance.Find(testPerformance.GetId());

            Assert.Equal(testPerformance, foundPerformance);
        }
        public void T4_Save_AssignsIdToPerformance()
        {
            DateTime performanceDate = new DateTime(2016, 08, 04);

            Performance testPerformance = new Performance(1, 2, performanceDate);

            testPerformance.Save();

            Performance savedPerformance = Performance.GetAll()[0];
            int         result           = savedPerformance.GetId();
            int         testId           = testPerformance.GetId();

            Assert.Equal(testId, result);
        }
Exemple #3
0
        public override bool Equals(System.Object otherPerformance)
        {
            if (!(otherPerformance is Performance))
            {
                return(false);
            }
            else
            {
                Performance newPerformance          = (Performance)otherPerformance;
                bool        idEquality              = this.GetId() == newPerformance.GetId();
                bool        venueIdEquality         = this.GetVenueId() == newPerformance.GetVenueId();
                bool        bandIdEquality          = this.GetBandId() == newPerformance.GetBandId();
                bool        performanceDateEquality = this.GetPerformanceDate() == newPerformance.GetPerformanceDate();

                return(idEquality && venueIdEquality && bandIdEquality && performanceDateEquality);
            }
        }