public void AggregateChild_AddEvent_Throws_Exception() { // arrange var sut = new ChildModel(); // act Action act = () => sut.AddEvent(new SomeEvent(new RootModel())); // assert act.Should().Throw <InvalidOperationException>(); }
public void AggregateChild_AddEvent_Succeeds() { // arrange var root = new RootModel(); var sut = new ChildModel(); sut.SetParent(root); // act sut.AddEvent(new SomeEvent(root)); // assert sut.Parent.Should().NotBeNull(); sut.Parent?.EventQueue.Should().NotBeEmpty(); }