Ejemplo n.º 1
0
        public void AddPartToDeliveryPointShouldAddPartToDeliveryPoint()
        {
            StoragePoint receivedDeliveryPoint = null;
            Part         receivedPart          = null;
            var          expected     = new Part();
            var          storagePoint = new StoragePoint();

            _storageSystem.DeliveryPoints.Add(storagePoint);
            var insertPartEvent = _eventAggregator.GetEvent <PubSubEvent <InsertPartToDeliveryEvent> >();

            insertPartEvent.Subscribe(e =>
            {
                receivedPart          = e.Part;
                receivedDeliveryPoint = e.DeliveryPoint;
            });

            _storageSystem.AddPartToDeliveryPoint(storagePoint, expected);

            storagePoint.Parts.Count.Should().Be(1);
            storagePoint.Parts.First().Should().Be(expected);
            receivedPart.Should().Be(expected);
            receivedDeliveryPoint.Should().Be(storagePoint);
        }