public BodyMassIndexReport(string height, string weight) { this.Height = height; this.Weight = weight; var validation = new AllValidation(); var areValidInputs = validation.IsValid(this); if (!areValidInputs) { return; } IsValid = true; var dWeight = GeneralValidation.MapStringToDecimal(weight); var dHeight = GeneralValidation.MapStringToDecimal(height); BmiCalculator = new BodyMassIndex(dHeight, dWeight); }
[TestCase("3", "4", ExpectedResult = true)] // true true public bool WhenHeightAndWeightAreValues_ThenValidatorSucceedsOrFails(string height, string weight) { var validator = new AllValidation(); return(validator.IsValid(new BodyMassIndexReport(height, weight))); }