public void GivenItemWithRoute_WhenTargetPortFull_ShouldNotRouteSingleItem() { ModuleB.SimulateIsFull(0); var item = new PlatformItem(); item.Route = new Route { RouteItems = new Collection <RouteItem> { new RouteItem { ModuleType = 1 }, new RouteItem { ModuleType = 2 }, } }; ModuleA.SimulateNewItemCreated(item); ModuleA.TestCurrentItemRoutings.Should().HaveCount(0, "must not route because target port is full"); ModuleA.SimulateItemDetected(item); ModuleA.TestCurrentItemRoutings.Should().HaveCount(0, "must not route because target port is still full"); }
public void GivenTargetIsFull_WhenRouteAll_ShouldNotRoute() { ModuleA.Entities.PlatformItems.Add(new PlatformItem()); ModuleB.SimulateIsFull(0); ModuleBusManager.ForcePath(ModuleA, ModuleB, 0, 0); ModuleA.TestCurrentAllPortRoutings.Should().HaveCount(0, "ModuleA must not route items because target is full"); }
public void GivenRouteAll_WhenDestinationGetsFull_ShouldStopRouting() { var item = new PlatformItem(); ModuleA.Entities.PlatformItems.Add(item); ModuleBusManager.ForcePath(ModuleA, ModuleB, 0, 0); ModuleB.SimulateIsFull(0); ModuleA.TestCurrentAllPortRoutings.Should().HaveCount(0, "ModuleA must not route items because target is full now"); }
public void GivenItemWithRoute_GivenFull_WhenNotFullAnymore_ShouldRouteSingleItem() { var item = new PlatformItem { ItemId = 1 }; item.Route = CreateRoute(); ModuleB.SimulateIsFull(0); ModuleA.SimulateNewItemCreated(item); ModuleA.SimulateItemDetected(item); ModuleA.TestCurrentItemRoutings.Should().BeEmpty(); ModuleB.SimulateIsNotFull(0); ModuleA.SimulateItemDetected(item); ModuleA.TestCurrentItemRoutings.Should().HaveCount(1); }