コード例 #1
0
        public override Robot CreateRobot(RobotModel model)
        {
            Robot robot = new WorkerRobot(model);

            robot.DecodingProbability = 100;
            robot.Carrying            = 10;
            return(robot);
        }
コード例 #2
0
        public void SaveRobotStateTest()
        {
            //Arrange
            var robot = new WorkerRobot(null)
            {
                BatteryCharge = 30
            };

            //Act
            var result = robot.SaveState();

            //Assert
            Assert.Equal(30, result.BatteryCharge);
        }
コード例 #3
0
ファイル: FactoriesTest.cs プロジェクト: P0linux/RobotGame
        public void CreateWorkerRobotTest()
        {
            //Arrange
            var expected = new WorkerRobot(null)
            {
                DecodingProbability = 10, Carrying = 20
            };
            var robotCreator = new WorkerRobotCreator();

            //Act
            var result = robotCreator.CreateRobot(null);

            //Assert
            expected.Should().BeEquivalentTo(result);
        }