public void SetUp() { _eventBroker = Substitute.For<IEventBroker>(); DomainEvents.SetEventBrokerStrategy(_eventBroker); _fred = new Student(); _law = new Subject(); // Act _fred.EnrolIn(_law); }
public void TheyShouldNotBePermitted() { var fred = new Student(); var law = new Subject { MaxStudents = 0, }; fred.EnrolIn(law); Assert.Inconclusive("This is our mission for tomorrow morning. We need to add a non-default constructor to our entity so that we can reliably create instances in a valid state."); }
partial void DeleteSubject(Subject instance);
partial void UpdateSubject(Subject instance);
partial void InsertSubject(Subject instance);
public void EnrolIn(Subject subject) { subject.AcceptEnrolmentFor(this); }
public bool IsEnrolledIn(Subject subject) { return StudentSubjectEnrolments .Where(sse => sse.SubjectId == subject.Id) .Any(); }