コード例 #1
0
        public void AddStoragePointShouldAddStoragePoint()
        {
            StoragePoint receivedStoragePoint = null;
            var          expected             = new StoragePoint();
            var          addStoragePointEvent = _eventAggregator.GetEvent <PubSubEvent <AddStoragePointEvent> >();

            addStoragePointEvent.Subscribe(receivedEvent => receivedStoragePoint = receivedEvent.StoragePoint);

            _storageSystem.AddStoragePoint(expected);

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

            storagePoint.Should().Be(expected);
            receivedStoragePoint.Should().Be(expected);
        }