예제 #1
0
        public bool FlagChangesFromSection(Section verSec)
        {
            SubjectVer          = Subject.Equals(verSec.Subject);
            CatalogNbrVer       = CatalogNbr.Equals(verSec.CatalogNbr);
            ClassDescrVer       = ClassDescr.Equals(verSec.ClassDescr);
            SectionVer          = SectionName.Equals(verSec.SectionName);
            ConsentVer          = Consent.Equals(verSec.Consent);
            EnrlCapVer          = EnrlCap.Equals(verSec.EnrlCap);
            TopicDescrVer       = TopicDescr.Equals(verSec.TopicDescr);
            MeetingStartDtVer   = MeetingStartDt.Equals(verSec.MeetingStartDt);
            MeetingEndDtVer     = MeetingEndDt.Equals(verSec.MeetingEndDt);
            FacilityIdVer       = FacilityId.Equals(verSec.FacilityId);
            MeetingTimeStartVer = MeetingTimeStart.Equals(verSec.MeetingTimeStart);
            MeetingTimeEndVer   = MeetingTimeEnd.Equals(verSec.MeetingTimeEnd);
            MonVer                = Mon.Equals(verSec.Mon);
            TuesVer               = Tues.Equals(verSec.Tues);
            WedVer                = Wed.Equals(verSec.Wed);
            ThursVer              = Thurs.Equals(verSec.Thurs);
            FriVer                = Fri.Equals(verSec.Fri);
            SatVer                = Sat.Equals(verSec.Sat);
            SunVer                = Sun.Equals(verSec.Sun);
            InstructorVer         = Instructor.Equals(verSec.Instructor);
            UnitsMinVer           = UnitsMin.Equals(verSec.UnitsMin);
            UnitsMaxVer           = UnitsMax.Equals(verSec.UnitsMax);
            ClassAssnComponentVer = ClassAssnComponent.Equals(verSec.ClassAssnComponent);

            HasNotBeenChanged = SubjectVer && CatalogNbrVer && ClassDescrVer && SectionVer && ConsentVer && EnrlCapVer && TopicDescrVer &&
                                MeetingStartDtVer && MeetingEndDtVer && FacilityIdVer && MeetingTimeStartVer && MeetingTimeEndVer && MonVer && TuesVer &&
                                WedVer && ThursVer && FriVer && SatVer && SunVer && InstructorVer && UnitsMinVer && UnitsMaxVer && ClassAssnComponentVer;

            return(HasNotBeenChanged);
        }
예제 #2
0
        public void EqualsObjectCastTest()
        {
            string  name    = "test-name";
            Consent consent = new Consent(name: name);
            object  obj     = new Consent(name: name);

            Assert.True(consent.Equals(obj));
        }
예제 #3
0
        public void EqualsTest()
        {
            string  name  = "test-name";
            Consent name1 = new Consent(name: name);

            Assert.Equal(name1, name1);
            Assert.Equal(name1, new Consent(name: name));
            Assert.NotEqual(name1, new Consent(name: name + "1"));
            Assert.False(name1.Equals(null));
        }
예제 #4
0
 /// <summary>
 /// A Section is equal to annother if all of its data has the same value as the other
 /// </summary>
 /// <param name="obj">the object to compare</param>
 /// <returns>true if equal</returns>
 public override bool Equals(object obj)
 {
     if (obj.GetType() == GetType())
     {
         Section s = (Section)obj;
         return(Course.Equals(s.Course) &&
                SectionNumber.Equals(s.SectionNumber) &&
                Instructor.Equals(s.Instructor) &&
                Consent.Equals(s.Consent) &&
                EnrollmentCap == s.EnrollmentCap &&
                TopicDescription.Equals(s.TopicDescription) &&
                MeetingStartDate.Equals(s.MeetingStartDate) &&
                MeetingEndDate.Equals(s.MeetingEndDate) &&
                Facility.Equals(s.Facility) &&
                MeetingTimeStart.Equals(s.MeetingTimeStart) &&
                MeetingTimeEnd.Equals(s.MeetingTimeEnd) &&
                UnitsMin == s.UnitsMin &&
                UnitsMax == s.UnitsMax &&
                ClassAssnComponent == s.ClassAssnComponent);
     }
     return(base.Equals(obj));
 }