public void GetRowAndColumn_Vertices_Null()
        {
            List <Vertex> vertices = null;

            Action act = () => TestImageGrid.GetRowAndColumn(vertices);

            act.Should().Throw <ArgumentNullException>("no vertices list is supplied");
        }
        public void GetRowAndColumn_Vertices_TooFew()
        {
            List <Vertex> vertices = new List <Vertex>();

            //check count is < 3 before act
            vertices.Count.Should().BeLessThan(3, "test action required input of less than three vertices to be valid ");

            //act
            Action act = () => TestImageGrid.GetRowAndColumn(vertices);

            act.Should().Throw <ArgumentOutOfRangeException>($"expected list of 3 vertices got {vertices.Count}");
        }
        [DataRow(65)] //outwith grid upper
        public void GetRowAndColumn_Vertices_InvalidVertexX(int invalidX)
        {
            List <Vertex> vertices = new List <Vertex>()
            {
                new Vertex()
                {
                    X = invalidX
                }, new Vertex(), new Vertex()
            };


            Action act = () => TestImageGrid.GetRowAndColumn(vertices);

            act.Should().Throw <ArgumentOutOfRangeException>($"invalid vertex X coordinate ({invalidX})");
        }
        public void GetRowAndColumn_GridBoundaries(string expectedRowAndColumn, int x1, int y1, int x2, int y2, int x3, int y3)
        {
            var expectedVertices = new List <Vertex>(3)
            {
                new Vertex {
                    X = x1, Y = y1
                }
                , new Vertex {
                    X = x2, Y = y2
                }
                , new Vertex {
                    X = x3, Y = y3
                }
            };



            var rowAndColumn = TestImageGrid.GetRowAndColumn(expectedVertices);

            rowAndColumn.Should().Be(expectedRowAndColumn, "the row letter and column number should be as expected");
        }