public void MinefieldResize_HeightInContainer(int fieldHeight, int fieldWidth, double heightRatio, double widthRatio)
        {
            MinefieldViewModelTest vm = new MinefieldViewModelTest(fieldHeight, fieldWidth);
            double height             = cellSizePx * heightRatio;
            double width = cellSizePx * widthRatio;

            vm.SetSize(width, height);

            Assert.LessOrEqual(vm.FieldHeightPx, height);
        }
        public void OneOfSideAllwaysHasMaximum(int fieldHeight, int fieldWidth, double heightRatio, double widthRatio)
        {
            MinefieldViewModelTest vm = new MinefieldViewModelTest(fieldHeight, fieldWidth);

            double height = cellSizePx * heightRatio;
            double width  = cellSizePx * widthRatio;

            vm.SetSize(width, height);

            bool widthIsMax  = width == vm.FieldWidthPx;
            bool heightIsMax = height == vm.FieldHeightPx;

            Assert.IsTrue(widthIsMax || heightIsMax);
        }
        public void CellProportionsMustBeNearSquare(int fieldHeight, int fieldWidth, double heightRatio, double widthRatio)
        {
            // Клетки должны быть примерно квадратными не зависимо от соотношения сторон поля.
            // Допустимо отклонение в 1-2 пикселя.
            //Так же нужно не забыть выполнить рефакторинг MinefieldViewModel:ResizeField

            MinefieldViewModelTest vm = new MinefieldViewModelTest(fieldHeight, fieldWidth);
            double height             = cellSizePx * heightRatio;
            double width = cellSizePx * widthRatio;

            vm.SetSize(width, height);

            double cellHeight = vm.FieldHeightPx / fieldHeight;
            double cellWidth  = vm.FieldWidthPx / fieldWidth;

            double allowableError = 2;

            Assert.LessOrEqual(Math.Abs(cellHeight - cellWidth), allowableError);
        }