Beispiel #1
0
        public void Process_NewDepartmentEvent_SetsNAmeAndId()
        {
            var id = Guid.NewGuid();
            var @event = new NewDepartmentEvent(id, "Test Department");
            var department = new Department();
            department.Process(@event);

            Assert.Equal(id, department.Id);
            Assert.Equal("Test Department", department.Name);
        }
 public Department GetById(Guid id)
 {
     var stream = _eventStore.Load(id);
     var department = new Department();
     foreach (var ev in stream)
     {
         department.Process(ev);
     }
     return department;
 }
Beispiel #3
0
        public void Process_NewCommitteeEvent_SetsCommitteeProperties()
        {
            var id = Guid.NewGuid();
            var @event = new NewCommitteeEvent(id, "Test Committee", "mandate");
            var department = new Department();
            department.Process(@event);

            var committee = department.Committees.First();
            Assert.Equal(id, committee.Id);
            Assert.Equal("Test Committee", committee.Name);
        }