public void testBottomSolidLayersOneMM(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue("bottom_solid_layers", out settingValue))
            {
                return;
            }

            Assert.AreEqual("1mm", settingValue, "bottom_solid_layers should be 1mm: " + sourceFile);
        }
        public void maxFanSpeedNotGreaterThanOneHundred(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue("max_fan_speed", out settingValue))
            {
                return;
            }

            Assert.LessOrEqual(int.Parse(settingValue), 100, "max_fan_speed should be less than or equal to 100: " + sourceFile);
        }
        public void noCurlyBracketsInEndGcode(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue("end_gcode", out settingValue))
            {
                return;
            }

            Assert.False(settingValue.Contains("{"), "end_gcode should not contain braces: " + sourceFile);
        }
        public void testExtruderCountGreaterThanZero(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue("extruder_count", out settingValue))
            {
                return;
            }

            Assert.Greater(int.Parse(settingValue), 0, "extruder_count should be greater than zero: " + sourceFile);
        }
        public void testRetractLengthLessThanTwenty(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue("retract_length", out settingValue))
            {
                return;
            }

            Assert.Less(float.Parse(settingValue, CultureInfo.InvariantCulture.NumberFormat), 20, "retract_length should be less than 20: " + sourceFile);
        }
        public void testFirstLayerBedTemperatureNotInStartGcode(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue(SettingsKey.start_gcode, out settingValue))
            {
                return;
            }

            Assert.False(settingValue.Contains(SettingsKey.first_layer_bed_temperature), "start_gcode should not contain first_layer_bed_temperature: " + sourceFile);
        }
        public void noCurlyBracketsInStartGcode(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue(SettingsKey.start_gcode, out settingValue))
            {
                return;
            }

            Assert.IsFalse(settingValue.Contains("{"), "start_gcode should not contain braces: " + sourceFile);
        }
        public void minimumFanSpeedLessThanOrEqualToOneHundred(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue(SettingsKey.min_fan_speed, out settingValue))
            {
                return;
            }

            Assert.LessOrEqual(int.Parse(settingValue), 100, "min_fan_speed should be less than or equal to 100: " + sourceFile);
        }
        public void printCenterFormatSeparatedByComma(PrinterSettingsLayer layer, string sourceFile)
        {
            string settingValue;

            if (!layer.TryGetValue(SettingsKey.print_center, out settingValue))
            {
                return;
            }

            string[] settingValueToTest = settingValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            Assert.AreEqual(2, settingValueToTest.Length, "print_center should have two values separated by a comma: " + sourceFile);
        }
        public void layerHeightLessThanNozzleDiameter(PrinterSettings printerSettings, PrinterSettingsLayer layer, string sourceFile)
        {
            string layerHeight;

            if (!layer.TryGetValue(SettingsKey.layer_height, out layerHeight))
            {
                return;
            }

            float convertedLayerHeight = float.Parse(layerHeight);

            string nozzleDiameter = printerSettings.GetValue(SettingsKey.nozzle_diameter);
            float  convertedNozzleDiameterValue = float.Parse(nozzleDiameter);

            Assert.LessOrEqual(convertedLayerHeight, convertedNozzleDiameterValue, "Unexpected layerHeightLessThanNozzleDiameter value: " + sourceFile);
        }
        public void firstLayerExtrusionWidthNotZero(PrinterSettingsLayer layer, string sourceFile)
        {
            string firstLayerExtrusionWidth;

            if (!layer.TryGetValue(SettingsKey.first_layer_extrusion_width, out firstLayerExtrusionWidth))
            {
                return;
            }

            float convertedFirstLayerExtrusionWidth;

            if (firstLayerExtrusionWidth.Contains("%"))
            {
                string reformatFirstLayerExtrusionWidth = firstLayerExtrusionWidth.Replace("%", " ");
                convertedFirstLayerExtrusionWidth = float.Parse(reformatFirstLayerExtrusionWidth);
            }
            else
            {
                convertedFirstLayerExtrusionWidth = float.Parse(firstLayerExtrusionWidth);
            }

            Assert.AreNotEqual(0, convertedFirstLayerExtrusionWidth, "Unexpected firstLayerExtrusionWidthNotZero value: " + sourceFile);
        }