public string Map(ApproachCheckResult approachCheckResult)
        {
            string approachCheckResultMapped;

            switch (approachCheckResult)
            {
            case ApproachCheckResult.Clash:
                approachCheckResultMapped = ClashMessage;
                break;

            case ApproachCheckResult.Out:
                approachCheckResultMapped = OutMessage;
                break;

            default:
                approachCheckResultMapped = OkMessage;
                break;
            }

            return(approachCheckResultMapped);
        }
示例#2
0
        private static void Given_A_Landing_Strategy_And_A_Position_Out_Of_The_Landing_Platform_When_Checking_A_Landing_Position(int positionXRocketTwo, int positionYRocketTwo)
        {
            // Arrange
            const int positionXRocketOne             = 10;
            const int positionYRocketOne             = 10;
            const ApproachCheckResult expectedResult = ApproachCheckResult.Out;

            var rocketOneId       = GuidGenerator.Create(1);
            var positionRocketOne = new Position(positionXRocketOne, positionYRocketOne);

            var rocketTwoId       = GuidGenerator.Create(2);
            var positionRocketTwo = new Position(positionXRocketTwo, positionYRocketTwo);

            var platformDimension = new Dimension(10, 10, 2, 2);
            var sut = new ZartisExerciseStrategy();

            sut.CheckApproach(rocketOneId, positionRocketOne, platformDimension);

            // Act
            var result = sut.CheckApproach(rocketTwoId, positionRocketTwo, platformDimension);

            // Assert
            result.Should().Be(expectedResult);
        }
示例#3
0
 protected override void Given()
 {
     _sut = new ApproachCheckResultMapper();
     _approachCheckResult = ApproachCheckResult.Clash;
     _expectedMessage     = "clash";
 }
示例#4
0
 protected override void Given()
 {
     _sut = new ApproachCheckResultMapper();
     _approachCheckResult = ApproachCheckResult.Out;
     _expectedMessage     = "out of platform";
 }
示例#5
0
 protected override void Given()
 {
     _sut = new ApproachCheckResultMapper();
     _approachCheckResult = ApproachCheckResult.Ok;
     _expectedMessage     = "ok for landing";
 }