protected override void Given() { const int x = 5; const int y = 5; var positionOne = new PositionBuilder() .WithX(x) .WithY(y) .Build(); _positionTwo = new PositionBuilder() .WithX(x + 2) .WithY(y + 2) .Build(); var landingPlatform = new LandingPlatformMockBuilder() .WithIsPositionInsideOfPlatformMocked(IsPositionInsideOfThePlatform) .WithIsAllowedPositionMocked(IsAllowedPosition) .Build(); _sut = new LandingAreaBuilder() .WithLandingPlatform(landingPlatform) .Build(); _sut.CheckPosition(positionOne); _expectedResult = LandingAnswer; _expectedPositions = StoredPositions; }
protected override void Given() { _position = new PositionBuilder().Build(); var landingAreaForRocketOne = new LandingAreaMockBuilder() .WithCheckPositionMocked(LandingAnswerForRocketOne, _position) .Build(); var rocketOne = new RocketBuilder() .WithLandingArea(landingAreaForRocketOne) .Build(); rocketOne.AskForPosition(_position); var landingAreaForRocketTwo = new LandingAreaMockBuilder() .WithCheckPositionMocked(LandingAnswerForRocketTwo, _position) .Build(); _sut = new RocketBuilder() .WithLandingArea(landingAreaForRocketTwo) .Build(); _expectedResult = LandingAnswerForRocketTwo; }
public LandingAreaMockBuilder WithCheckPositionMocked(LandingAnswers landingAnswer, Position position = null) { _landingAreaMock .Setup(landingArea => landingArea.CheckPosition(position ?? It.IsAny <Position>())) .Returns(landingAnswer); return(this); }
protected override void Given() { _position = new PositionBuilder().Build(); var landingArea = new LandingAreaMockBuilder() .WithCheckPositionMocked(LandingAnswer, _position) .Build(); _sut = new RocketBuilder() .WithLandingArea(landingArea) .Build(); _expectedResult = LandingAnswer; }
protected override void Given() { _position = new PositionBuilder().Build(); var landingPlatform = new LandingPlatformMockBuilder() .WithIsPositionInsideOfPlatformMocked(IsPositionInsideOfThePlatform) .Build(); _sut = new LandingAreaBuilder() .WithLandingPlatform(landingPlatform) .Build(); _expectedResult = LandingAnswer; _expectedPositions = StoredPositions; }
protected override void When() { _result = _sut.AskForPosition(_position); }
protected override void When() { _result = _sut.CheckPosition(_position); }