예제 #1
0
        public void AddStoreShouldAddStore()
        {
            Store receivedStore = null;
            var   expected      = new Store();
            var   addStoreEvent = _eventAggregator.GetEvent <PubSubEvent <AddStoreEvent> >();

            addStoreEvent.Subscribe(receivedEvent => receivedStore = receivedEvent.Store);

            _storageSystem.AddStore(expected);

            Task.Delay(25).Wait();
            _storageSystem.Stores.Count.Should().Be(1);
            var store = _storageSystem.Stores.First();

            store.Should().Be(expected);
            receivedStore.Should().Be(expected);
        }