public void CannotAttachTrailerTwice() { var trailerHook = new TrailerHook(); Assert.Throws <DomainRuleViolatedException>(() => { trailerHook.AttachTrailer(); trailerHook.AttachTrailer(); }); }
public void AttachingTrailerResultsInEvent() { var trailerHook = new TrailerHook(); var events = trailerHook.AttachTrailer(); Assert.True(events.Any(x => x is TrailerHookBecameOccupied)); }
public void DetachingTrailerResultsInEvent() { var trailerHook = new TrailerHook(); trailerHook.AttachTrailer(); var events = trailerHook.DetachTrailer(); Assert.True(events.Any(x => x is TrailerHookStoppedBeingOccupied)); }