示例#1
0
        public void ValidLocation_ValidLocations_TrueReturned()
        {
            //Arrange
            bool           expected = true;
            TriangularGrid tGrid    = new TriangularGrid(60, 60, 10);

            List <Coordinate> locations = new List <Coordinate>
            {
                new Coordinate {
                    X = 10, Y = 50
                },
                new Coordinate {
                    X = 20, Y = 50
                },
                new Coordinate {
                    X = 20, Y = 60
                }
            };

            //Act
            bool actual = tGrid.ValidLocations(locations);

            //Assert
            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void ValidLocation_InValidHeightLocations_FalseReturned()
        {
            //Arrange
            bool           expected = false;
            int            height   = 60;
            TriangularGrid tGrid    = new TriangularGrid(height, 60, 10);

            List <Coordinate> locations = new List <Coordinate>
            {
                new Coordinate {
                    X = 10, Y = height + 10
                }
            };

            //Act
            bool actual = tGrid.ValidLocations(locations);

            //Assert
            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void ValidLocation_InValidWidthLocations_FalseReturned()
        {
            //Arrange
            bool           expected = false;
            int            width    = 60;
            TriangularGrid tGrid    = new TriangularGrid(60, width, 10);

            List <Coordinate> locations = new List <Coordinate>
            {
                new Coordinate {
                    X = width + 10, Y = 50
                }
            };

            //Act
            bool actual = tGrid.ValidLocations(locations);

            //Assert
            Assert.AreEqual(expected, actual);
        }