当前位置: 首页>>代码示例>>C#>>正文


C# Manager.Store方法代码示例

本文整理汇总了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());
 }
开发者ID:renxiaobai,项目名称:CabinetSystem_weiming,代码行数:9,代码来源:ManagerTest.cs

示例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);
 }
开发者ID:slbzyu2,项目名称:OOBootcamp_Eric,代码行数:10,代码来源:ManagerTest.cs

示例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());
 }
开发者ID:slbzyu2,项目名称:OOBootcamp_Eric,代码行数:10,代码来源:ManagerTest.cs

示例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);
        }
开发者ID:hjyao,项目名称:SuperMarketLockerSystem,代码行数:18,代码来源:ManagerTest.cs

示例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);
        }
开发者ID:slbzyu2,项目名称:OOBootcamp_Eric,代码行数:11,代码来源:ManagerTest.cs

示例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));
        }
开发者ID:hjyao,项目名称:SuperMarketLockerSystem,代码行数:24,代码来源:ManagerTest.cs


注:本文中的Manager.Store方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。