private void perfValidateStep(correctResponsesTypeCorrectResponsePerformanceStep step, string name, decimal?min, decimal?max, string msg) { Assert.AreEqual(name, step.stepName, "step name validation: " + msg); Assert.IsAssignableFrom(typeof(correctResponsesTypeCorrectResponsePerformanceStepStepAnswerNumeric), step.stepAnswer.Item, step.stepAnswer.Item.ToString() + " - " + msg); correctResponsesTypeCorrectResponsePerformanceStepStepAnswerNumeric numAnswer = (correctResponsesTypeCorrectResponsePerformanceStepStepAnswerNumeric)step.stepAnswer.Item; Assert.AreEqual(max != null, numAnswer.maxSpecified, "step max specified valiation: " + msg); if (max != null) { Assert.AreEqual(max.Value, numAnswer.max, "step max value valiation: " + msg); } Assert.AreEqual(min != null, numAnswer.minSpecified, "step min specified valiation: " + msg); if (min != null) { Assert.AreEqual(min.Value, numAnswer.min, "step min value valiation: " + msg); } }
public correctResponsesTypeCorrectResponsePerformanceStep(string stepName, Decimal?min, Decimal?max) { this.stepName = stepName; this.stepAnswer = new correctResponsesTypeCorrectResponsePerformanceStepStepAnswer(); correctResponsesTypeCorrectResponsePerformanceStepStepAnswerNumeric numAnswer = new correctResponsesTypeCorrectResponsePerformanceStepStepAnswerNumeric(); if (!(min == null)) { numAnswer.minSpecified = true; numAnswer.min = min.Value; } if (!(max == null)) { numAnswer.maxSpecified = true; numAnswer.max = max.Value; } this.stepAnswer.Item = numAnswer; }