public void GetBehindnessVectors_PositionHasNonZeroComponents_ReturnsCorrectVectors() { var postprocessor = new BasicFovPostprocessor(); var positionPositivePositive = new Position(12, 30); var positionNegativePositive = new Position(-5, 14); var positionPositiveNegative = new Position(11, -1); var positionNegativeNegative = new Position(-5, -5); var squareCenter = new Position(0, 0); IEnumerable <Position> resultPosPos = postprocessor.GetBehindnessVectors(positionPositivePositive, squareCenter); IEnumerable <Position> resultNegPos = postprocessor.GetBehindnessVectors(positionNegativePositive, squareCenter); IEnumerable <Position> resultPosNeg = postprocessor.GetBehindnessVectors(positionPositiveNegative, squareCenter); IEnumerable <Position> resultNegNeg = postprocessor.GetBehindnessVectors(positionNegativeNegative, squareCenter); resultPosPos.Should().BeEquivalentTo(new List <Position> { new Position(1, 0), new Position(0, 1) }); resultNegPos.Should().BeEquivalentTo(new List <Position> { new Position(-1, 0), new Position(0, 1) }); resultPosNeg.Should().BeEquivalentTo(new List <Position> { new Position(1, 0), new Position(0, -1) }); resultNegNeg.Should().BeEquivalentTo(new List <Position> { new Position(-1, 0), new Position(0, -1) }); }
public void GetBehindnessVectors_PositionHasOneZeroComponent_ReturnsCorrectVectors() { var postprocessor = new BasicFovPostprocessor(); var positionPositiveZero = new Position(12, 0); var positionZeroPositive = new Position(0, 14); var positionNegativeZero = new Position(-7, 0); var positionZeroNegative = new Position(0, -5); var squareCenter = new Position(0, 0); IEnumerable <Position> resultPosZero = postprocessor.GetBehindnessVectors(positionPositiveZero, squareCenter); IEnumerable <Position> resultZeroPos = postprocessor.GetBehindnessVectors(positionZeroPositive, squareCenter); IEnumerable <Position> resultNegZero = postprocessor.GetBehindnessVectors(positionNegativeZero, squareCenter); IEnumerable <Position> resultZeroNeg = postprocessor.GetBehindnessVectors(positionZeroNegative, squareCenter); resultPosZero.Should().BeEquivalentTo(new List <Position> { new Position(1, 0) }); resultZeroPos.Should().BeEquivalentTo(new List <Position> { new Position(0, 1) }); resultNegZero.Should().BeEquivalentTo(new List <Position> { new Position(-1, 0) }); resultZeroNeg.Should().BeEquivalentTo(new List <Position> { new Position(0, -1) }); }
public void GetBehindnessVectors_ReturnsCorrectVectors(int offsetX, int offsetY) { var postprocessor = new BasicFovPostprocessor(); var offset = new Position(offsetX, offsetY); var currentPosition = new Position(1, 1) + offset; var squareCenter = new Position(0, 0) + offset; IEnumerable <Position> result = postprocessor.GetBehindnessVectors(currentPosition, squareCenter); result.Should().BeEquivalentTo(new List <Position> { new Position(1, 0), new Position(0, 1) }); }