public void CreateNew() { var newAppointment = new Appointment.Create() { ClientId = 123, VisitDate = new DateTime(2008, 07, 06, 05, 04, 03), Notes = "appointment notes", } .Execute(); AssertIsPersisted(newAppointment); Assert.That(newAppointment.ClientId, Is.EqualTo(123)); Assert.That(newAppointment.VisitDate, Is.EqualTo(new DateTime(2008, 07, 06))); Assert.That(newAppointment.Notes, Is.EqualTo("appointment notes")); }
public void Execute() { var controller = new OnlineController(); var cmd = new Appointment.Create() { ClientId = 123, VisitDate = new DateTime(2009, 08, 07), Notes = "test notes", }; var createdAppointment = new AppointmentBuilder().Build(); RootStub.StubExecute(cmd, createdAppointment); var result = (Appointment)controller.Execute(cmd).Data; Assert.That(result, Is.SameAs(createdAppointment)); }