public void Distance_One_Value_Positive()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(12.51645f, 1f);

            Assert.AreEqual(12, result);
        }
        public void Distance_Half_Value_Negative()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(-865.1223f, 0.5f);

            Assert.AreEqual(-865.5f, result);
        }
        public void Distance_Half_Value_Positive()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(631.54123f, 0.5f);

            Assert.AreEqual(631.5f, result);
        }
        public void Distance_Two_Value_Negative()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(-31.1223f, 2f);

            Assert.AreEqual(-32f, result);
        }
        public void Distance_Two_Value_Positive()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(11.05612f, 2f);

            Assert.AreEqual(10, result);
        }
        public void Distance_One_Value_Negative()
        {
            Tiles tiles = new TilesBuilder().Build();

            float result = tiles.GetValueBasedOnDistance(-66.213f, 1f);

            Assert.AreEqual(-67f, result);
        }
Esempio n. 7
0
        public void HalfByHalfByHalf_Negative()
        {
            Tiles tiles = new TilesBuilder().AddDistanceBetweenTiles(new Vector3(0.5f, 0.5f, 0.5f))
                          .Build();

            Vector3 result = tiles.GetTileUnderPointer(new Vector3(-42.213f, -11.9464f, -88.1234f));

            Assert.AreEqual(new Vector3(-42.5f, -12f, -88.5f), result);
        }
Esempio n. 8
0
        public void HalfByHalfByHalf_Positive()
        {
            Tiles tiles = new TilesBuilder().AddDistanceBetweenTiles(new Vector3(0.5f, 0.5f, 0.5f))
                          .Build();

            Vector3 result = tiles.GetTileUnderPointer(new Vector3(6.434f, 63.8213f, 9.89038f));

            Assert.AreEqual(new Vector3(6f, 63.5f, 9.5f), result);
        }
Esempio n. 9
0
        public void OneByOneByOne_Negative()
        {
            Tiles tiles = new TilesBuilder().AddDistanceBetweenTiles(Vector3.one)
                          .Build();

            Vector3 result = tiles.GetTileUnderPointer(new Vector3(-93.34224f, -12.72323f, -3.12038f));

            Assert.AreEqual(new Vector3(-94f, -13f, -4f), result);
        }
Esempio n. 10
0
        public void OneByOneByOne_Positive()
        {
            Tiles tiles = new TilesBuilder().AddDistanceBetweenTiles(Vector3.one)
                          .Build();

            Vector3 result = tiles.GetTileUnderPointer(new Vector3(2.3434f, 3.723123f, 9.89038f));

            Assert.AreEqual(new Vector3(2f, 3f, 9f), result);
        }
        public void BuildTilesFromInputString(int testNumber)
        {
            var input             = GetInputString(testNumber);
            var registry          = new DispatchRegistry();
            var fakeRandomNumbers = new FakeRandomNumberGenerator();
            var tiles             = TilesBuilder.BuildTiles(input, registry, fakeRandomNumbers);

            var actual   = tiles.ToString();
            var expected = GetExpectedTiles(testNumber);

            _output.WriteLine('='.ToPaddedString(10));
            _output.WriteLine(expected);
            _output.WriteLine('='.ToPaddedString(10));
            _output.WriteLine(actual);
            _output.WriteLine('='.ToPaddedString(10));

            Assert.Equal(expected, actual);
        }