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


C# Rover.Init方法代码示例

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


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

示例1: Init_InitialCoordinatesAndOrientation_RoverOrientationMustBeEqualToInitialOrientation

        public void Init_InitialCoordinatesAndOrientation_RoverOrientationMustBeEqualToInitialOrientation()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(0, 0);
            var orientation = new NorthOrientation();
            var finalOrientation = new NorthOrientation();

            // Act
            rover.Init(initialCoordinates, orientation);

            // Asset
            Assert.That(rover.Orientation, Is.EqualTo(finalOrientation));
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:14,代码来源:RoverTests.cs

示例2: Move_InitialStateIs00E_FinalStateShouldBe10E

        public void Move_InitialStateIs00E_FinalStateShouldBe10E()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(0, 0);
            rover.Init(initialCoordinates, new EastOrientation());

            // Act
            rover.Move();

            //Assert
            Assert.That(rover.Coordinates, Is.EqualTo(new Coordinates(1, 0)));
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:13,代码来源:RoverTests.cs

示例3: TurnRight_InitialOrientationIsWest_FinalOrientationShouldBeNorth

        public void TurnRight_InitialOrientationIsWest_FinalOrientationShouldBeNorth()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(0, 0);
            rover.Init(initialCoordinates, new WestOrientation());

            // Act
            rover.TurnRight();

            //Assert
            Assert.That(rover.Orientation, Is.EqualTo(new NorthOrientation()));
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:13,代码来源:RoverTests.cs

示例4: TurnLeft_InitialOrientationIsSouth_FinalOrientationShouldBeEast

        public void TurnLeft_InitialOrientationIsSouth_FinalOrientationShouldBeEast()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(0, 0);
            rover.Init(initialCoordinates, new SouthOrientation());

            // Act
            rover.TurnLeft();

            //Assert
            Assert.That(rover.Orientation, Is.EqualTo(new EastOrientation()));
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:13,代码来源:RoverTests.cs

示例5: Move_InitialStateIs55NAndPlateauIsSetTo55_OutOfPlateauException

        public void Move_InitialStateIs55NAndPlateauIsSetTo55_OutOfPlateauException()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(5, 5);
            rover.Init(initialCoordinates, new NorthOrientation());

            var upperLeft = new Coordinates(5, 5);
            var plateau = new Plateau(upperLeft);

            rover.SetPlateau(plateau);

            // Act
            rover.Move();
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:15,代码来源:RoverTests.cs

示例6: Move_InitialStateIs33WAndPlateauIsSetTo55_TheNewCoordinatesShouldBe23W

        public void Move_InitialStateIs33WAndPlateauIsSetTo55_TheNewCoordinatesShouldBe23W()
        {
            // Arrange
            var rover = new Rover();
            var initialCoordinates = new Coordinates(3, 3);
            rover.Init(initialCoordinates, new WestOrientation());

            var upperLeft = new Coordinates(5, 5);
            var plateau = new Plateau(upperLeft);

            rover.SetPlateau(plateau);

            // Act
            rover.Move();

            // Assert
            Assert.That(rover.Coordinates, Is.EqualTo(new Coordinates(2, 3)));
            Assert.That(rover.Orientation, Is.EqualTo(new WestOrientation()));
        }
开发者ID:jruizx,项目名称:MarsRoversProblem,代码行数:19,代码来源:RoverTests.cs


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