public void ProcessManager_can_emit_command() { var processManager = new TestProcessManager(); processManager.Handle("processId", new TestEvent("abcde", "name")); processManager.AsIProcessManager().UncommittedCommands.Count().Should().Be(1); processManager.Handle(new TestEventEnd("abc")); processManager.ProcessEnded.Should().Be(true); }
public void ProcessManager_ignores_unknown_event() { var processManager = new TestProcessManager(); processManager.Handle("processId", new TestEvent("abcde", "name")); processManager.AsIProcessManager().ClearUncommittedEvents(); processManager.AsIProcessManager().ClearUncommittedCommands(); processManager.ProcessEnded.Should().BeFalse(); ((IProcessManager)processManager).Handle(new TestEventUnknown("abc")); processManager.AsIProcessManager().UncommittedCommands.Count().Should().Be(0); processManager.AsIProcessManager().UncommittedEvents().Count().Should().Be(0); processManager.ProcessEnded.Should().Be(false); }