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


C# Rover.Deploy方法代码示例

本文整理汇总了C#中Rover.Deploy方法的典型用法代码示例。如果您正苦于以下问题:C# Rover.Deploy方法的具体用法?C# Rover.Deploy怎么用?C# Rover.Deploy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rover的用法示例。


在下文中一共展示了Rover.Deploy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Asks_if_deploy_point_is_valid_for_landing_surface

 public void Asks_if_deploy_point_is_valid_for_landing_surface()
 {
     var aPoint = new Point(0, 0);
     mockLandingSurface.Setup(x => x.IsValid(aPoint)).Returns(true);
     var rover = new Rover();
     rover.Deploy(mockLandingSurface.Object, aPoint, CardinalDirection.South);
     mockLandingSurface.Verify(x => x.IsValid(aPoint), Times.Once());
 }
开发者ID:emretiryaki,项目名称:MarsRover,代码行数:8,代码来源:RoverTests.cs

示例2: Given_valid_deploy_point_and_direction_exposes_as_properties

            public void Given_valid_deploy_point_and_direction_exposes_as_properties(int expectedX, int expectedY, CardinalDirection expectedCardinalDirection)
            {
                var expectedPoint = new Point(expectedX, expectedY);
                mockLandingSurface.Setup(x => x.IsValid(expectedPoint)).Returns(true);

                var rover = new Rover();
                rover.Deploy(mockLandingSurface.Object, expectedPoint, expectedCardinalDirection);

                Assert.AreEqual(expectedPoint, rover.Position);
                Assert.AreEqual(expectedCardinalDirection, rover.CardinalDirection);
            }
开发者ID:emretiryaki,项目名称:MarsRover,代码行数:11,代码来源:RoverTests.cs

示例3: Given_invalid_deploy_point_throws_RoverDeployException

            public void Given_invalid_deploy_point_throws_RoverDeployException()
            {
                var aPoint = new Point(0, 0);
                var aSize = new Size(0, 0);

                mockLandingSurface.Setup(x => x.IsValid(aPoint)).Returns(false);
                mockLandingSurface.Setup(x => x.GetSize()).Returns(aSize);
                var rover = new Rover();

                Assert.Throws<RoverDeployException>(() =>
                    rover.Deploy(mockLandingSurface.Object, aPoint, CardinalDirection.West));
            }
开发者ID:emretiryaki,项目名称:MarsRover,代码行数:12,代码来源:RoverTests.cs

示例4: After_Rover_has_been_deployed_returns_true

            public void After_Rover_has_been_deployed_returns_true()
            {
                var point = new Point(0, 0);
                mockLandingSurface.Setup(x => x.IsValid(point)).Returns(true);
                var rover = new Rover();
                rover.Deploy(mockLandingSurface.Object, point, CardinalDirection.North);

                var isDeployed = rover.IsDeployed();

                Assert.That(isDeployed);
            }
开发者ID:emretiryaki,项目名称:MarsRover,代码行数:11,代码来源:RoverTests.cs

示例5: Alters_position_and_direction_in_response_to_movement_list

            public void Alters_position_and_direction_in_response_to_movement_list(int startX, int startY, 
                CardinalDirection startDirection, Movement firstMove, Movement secondMove, Movement thirdMove, 
                int expectedX, int expectedY, CardinalDirection expectedDirection)
            {
                var startPosition = new Point(startX, startY);
                var expectedPosition = new Point(expectedX, expectedY);
                var movements = new List<Movement> {firstMove, secondMove, thirdMove};

                var mockLandingSurface = new Mock<ILandingSurface>();
                mockLandingSurface.Setup(x => x.IsValid(startPosition)).Returns(true);

                var rover = new Rover();
                rover.Deploy(mockLandingSurface.Object, startPosition, startDirection);
                rover.Move(movements);

                Assert.AreEqual(expectedPosition.X, rover.Position.X);
                Assert.AreEqual(expectedPosition.Y, rover.Position.Y);
                Assert.AreEqual(expectedDirection, rover.CardinalDirection);
            }
开发者ID:emretiryaki,项目名称:MarsRover,代码行数:19,代码来源:RoverTests.cs


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