Contains() 공개 메소드

public Contains ( ITimePeriod item ) : bool
item ITimePeriod
리턴 bool
        public void RemoveTest()
        {
            DateTime now = ClockProxy.Clock.Now;
            SchoolDay schoolDay = new SchoolDay( now );
            TimePeriodCollection timePeriods = new TimePeriodCollection();

            Assert.IsFalse( timePeriods.Contains( schoolDay.Lesson1 ) );
            timePeriods.Add( schoolDay.Lesson1 );
            Assert.IsTrue( timePeriods.Contains( schoolDay.Lesson1 ) );
            timePeriods.Remove( schoolDay.Lesson1 );
            Assert.IsFalse( timePeriods.Contains( schoolDay.Lesson1 ) );
        }
        public void ContainsPeriodTest()
        {
            DateTime now = ClockProxy.Clock.Now;
            SchoolDay schoolDay = new SchoolDay( now );
            TimePeriodCollection timePeriods = new TimePeriodCollection( schoolDay );

            TimeRange timeRange = new TimeRange( schoolDay.Lesson1.Start, schoolDay.Lesson1.End );
            Assert.IsFalse( timePeriods.Contains( timeRange ) );
            Assert.IsTrue( timePeriods.ContainsPeriod( timeRange ) );

            timePeriods.Add( timeRange );
            Assert.IsTrue( timePeriods.Contains( timeRange ) );
            Assert.IsTrue( timePeriods.ContainsPeriod( timeRange ) );
        }