using System; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; namespace TellDontAsk1 { [TestFixture] public class CalendarTests { private Calendar calendar; [SetUp] public void Setup() { calendar = new Calendar(); } [Test] public void AddAppointment() { var appointment = new Appointment(); appointment.Start = new DateTime(2008, 2, 19, 9, 0, 0); appointment.End = new DateTime(2008, 2, 19, 10, 0, 0); calendar.Appointments.Add(appointment); Assert.That(calendar.Free(new DateTime(2008, 2, 19, 9, 15, 0)), Is.False); } [Test] public void AddAppointment_fluent() { calendar.AddAppointment() .From(new DateTime(2008, 2, 19, 9, 0, 0)) .To(new DateTime(2008, 2, 19, 10, 0, 0)); Assert.That(calendar.Free(new DateTime(2008, 2, 19, 9, 15, 0)), Is.False); } } }