public void AddShelfToStoreShouldAddShelf() { Shelf receivedShelf = null; var expected = new Shelf(); var store = new Store(); _storageSystem.Stores.Add(store); var addShelfEvent = _eventAggregator.GetEvent <PubSubEvent <AddShelfEvent> >(); addShelfEvent.Subscribe(e => receivedShelf = e.Shelf); _storageSystem.AddShelfToStore(store, expected); Task.Delay(25).Wait(); store.Shelves.Count.Should().Be(1); var shelf = store.Shelves.First(); shelf.Should().Be(expected); receivedShelf.Should().Be(expected); }