本文整理汇总了C#中Manager.Store方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Store方法的具体用法?C# Manager.Store怎么用?C# Manager.Store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.Store方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_store_bag_when_has_empty_cabinet
public void Should_store_bag_when_has_empty_cabinet()
{
var mgr = new Manager();
var cabinet = new Cabinet(1);
var bag = new Bag();
mgr.Add(cabinet);
mgr.Store(bag);
Assert.IsFalse(mgr.HasEmptyBox());
}
示例2: TestManagerCouldPickBoxStoredFromManagerGivenManagerStoreBoxIntoCabinet
public void TestManagerCouldPickBoxStoredFromManagerGivenManagerStoreBoxIntoCabinet()
{
var manager = new Manager();
var cabinet = new Cabinet();
manager.Add(cabinet);
var bag = new Bag();
var ticket = manager.Store(bag, false);
var returnBag = manager.PickBag(ticket, false);
Assert.AreEqual(bag, returnBag);
}
示例3: TestManagerCouldGetEmptyBoxCountGivenManagerStoreBoxIntoCabinet
public void TestManagerCouldGetEmptyBoxCountGivenManagerStoreBoxIntoCabinet()
{
var manager = new Manager();
var cabinet1 = new Cabinet(10);
var cabinet2 = new Cabinet(10);
manager.Add(cabinet1);
manager.Add(cabinet2);
manager.Store(new Bag(), false);
Assert.AreEqual(19,manager.GetEmptyBoxCount());
}
示例4: should_pick_bag_given_existing_ticket
public void should_pick_bag_given_existing_ticket()
{
var locker = new Locker(1);
var lockers = new List<Locker> { locker };
var smartRobot = new SmartRobot(new List<Locker> {new Locker(1)});
var superRobot = new SuperRobot(new List<Locker> {new Locker(1)});
var robots = new List<SmartRobot> {
smartRobot,
superRobot
};
var manager = new Manager(lockers, robots);
var expectedBag = new Bag();
var ticket = manager.Store(expectedBag);
var actualBag = manager.Pick(ticket);
Assert.Equal(expectedBag, actualBag);
}
示例5: TestManagerCouldStoreBoxGivenManagerHasOneRobotAndOneCabinet
public void TestManagerCouldStoreBoxGivenManagerHasOneRobotAndOneCabinet()
{
var manager = new Manager();
var robot = new Robot();
var cabinet = new Cabinet();
robot.Add(cabinet);
manager.Add(robot);
var ticket = manager.Store(new Bag(), true);
Assert.IsNotNull(ticket);
}
示例6: should_store_bag_in_sequence_given_all_kinds_of_robots_and_lockers
public void should_store_bag_in_sequence_given_all_kinds_of_robots_and_lockers()
{
var locker = new Locker(1);
var lockers = new List<Locker> { locker };
var smartRobot = new SmartRobot(new List<Locker> {new Locker(1)});
var superRobot = new SuperRobot(new List<Locker> {new Locker(1)});
var robots = new List<SmartRobot> {
smartRobot,
superRobot
};
var manager = new Manager(lockers, robots);
var bag1 = new Bag();
var bag2 = new Bag();
var bag3 = new Bag();
var ticket1 = manager.Store(bag1);
var ticket2 = manager.Store(bag2);
var ticket3 = manager.Store(bag3);
Assert.Equal(bag1, locker.Pick(ticket1));
Assert.Equal(bag2, smartRobot.Pick(ticket2));
Assert.Equal(bag3, superRobot.Pick(ticket3));
}