Beispiel #1
0
        public void MosaicControlledJunctionEquipmentTests()
        {
            var targetModule1 = new ModuleSimulator(new Mock <ILogger>().Object, new Mock <IEquipmentRepository>().Object);
            var targetModule2 = new ModuleSimulator(new Mock <ILogger>().Object, new Mock <IEquipmentRepository>().Object);

            targetModule1.Initialize(10, "test1");
            targetModule2.Initialize(10, "test2");

            var mosaicControlledJunction = new SimulatedJunction(new Mock <ILogger>().Object);

            var testee = new JunctionEquipment();

            testee.Initialize(0, _module, mosaicControlledJunction, targetModule1, targetModule2);

            _module.Initialize(10, "test");
            _module.AddEquipment(testee);

            // route item-100 to lane 0
            mosaicControlledJunction.RouteItem(100, 0);
            _module.AddItem(new SimulatedItem {
                ItemId = 100
            });
            _module.ItemCount.Should().Be(0);
            targetModule1.ItemCount.Should().Be(1);

            // route item-200 to lane 1
            mosaicControlledJunction.RouteItem(200, 1);
            _module.AddItem(new SimulatedItem {
                ItemId = 200
            });
            _module.ItemCount.Should().Be(0);
            targetModule2.ItemCount.Should().Be(1);

            // dont specify a route, should go to next module
            _module.AddItem(new SimulatedItem {
                ItemId = 999
            });
            _module.ItemCount.Should().Be(1);
            _module.Takt();
            _module.ItemCount.Should().Be(1);
        }
 public SimulatedBehavior(IPlatformModuleRepository moduleRepository, BarcodeReaderEquipment readerEquipment, JunctionEquipment junctionEquipment)
 {
     _readerEquipment   = readerEquipment;
     _junctionEquipment = junctionEquipment;
     _mosaicModule      = moduleRepository.GetModulesByType <DemoModuleB>().First();
 }