public void Measurement_is_created_with_given_valid_length_weight_and_date() { Measurement measurement = new Measurement(NORMAL_LENGTH, NORMAL_WEIGHT, NORMAL_DATE); specify = () => measurement.length.should_be(NORMAL_LENGTH); specify = () => measurement.weight.should_be(NORMAL_WEIGHT); specify = () => measurement.date.should_be(NORMAL_DATE); }
public void GivenAnotherExistingMeasurementWithTheSameLengthTheSameWeightAndAnotherDate(int length, int weight, string date) { _length = length; _weight = weight; _date = DateTime.Parse(date); _measurement = new Measurement(_length, _weight, _date); }
public void ThenTheNewMeasurementIsAddedToMyBMIHistory() { Measurement m1 = new Measurement(_length, _weight, _date); Measurement m2 = _person.measurements.First(e => e.length == _length && e.weight == _weight && e.date == _date); Assert.AreEqual(m1.length, m2.length); Assert.AreEqual(m1.weight, m2.weight); Assert.AreEqual(m1.date, m2.date); }
public void resetParameters() { _measurement = null; _otherMeasurement = null; _length = 0; _weight = 0; _date = new DateTime(); _ex = null; _result = null; }
public void WhenIWantToMakeANewMeasurementWithLengthWeightAndDate(int length, int weight, string date) { _length = length; _weight = weight; _date = DateTime.Parse(date); try { _measurement = new Measurement(_length, _weight, _date); } catch (Exception ex) { _ex = ex; } }
public Person(String socialSecurityNumber, DateTime birthDate, PersonDef.Gender gender, Measurement firstMeasurement) { if (socialSecurityNumber == null) { throw new ArgumentException("Invalid social security number"); } if (firstMeasurement == null) { throw new ArgumentException("Invalid first measurement"); } _measurements = new List<Measurement>(); this.socialSecurityNumber = socialSecurityNumber; _birthDate = birthDate; _gender = gender; addMeasurement(firstMeasurement); _isChanged = true; }
private void IWantToMakeANewMeasurementWithValidLengthAndInvalidWeight() { try { _measurement = new Measurement(ValidLength, InvalidWeight); } catch (Exception ex) { _ex = ex; } }
private void IWantToMakeANewMeasurementWithLengthAndWeightAndDate() { try { _measurement = new Measurement(LengthVal, WeightVal, DateTime.Parse(DateVal)); } catch (Exception ex) { _ex = ex; } }
private void IWantToMakeANewMeasurementWithLengthAndWeight() { try { _measurement = new Measurement(LengthVal, WeightVal); } catch (Exception ex) { _ex = ex; } }
public void WhenIWantToMakeANewMeasurementWithLengthWeightAndTheCurrentDate(int length, int weight) { _length = length; _weight = weight; _date = DateTime.Now; try { _measurement = new Measurement(_length, _weight, _date); } catch (Exception ex) { _ex = ex; } }
private void anExistingMeasurementWithDate(string date) { _measurement = new Measurement(_LENGTH, _WEIGHT, DateTime.Parse(date)); }
private void anotherExistingMeasurementWithAnotherLengthAndWeightAndTheSameDate(int length, int weight, String date) { _otherMeasurement = new Measurement(length, weight, DateTime.Parse(date)); }
public void GivenAValidMeasurementObjectIsGeneratedWithDate(String date) { _date = DateTime.Parse(date); _measurement = new Measurement(NORMAL_LENGTH, NORMAL_WEIGHT, _date); }
public void GivenAValidMeasurementObject() { _measurement = new Measurement(NORMAL_LENGTH, NORMAL_WEIGHT, NORMAL_DATE); }
public void WhenITryToCreateANewMeasurement() { try { _measurement = new Measurement(_length, _weight, _date); } catch (Exception ex) { _ex = ex; } }
public void WhenITryToCreateANewMeasurementObjectWithNormalLength(String circumstance) { try { _measurement = new Measurement(_length, _weight, _date); } catch (Exception ex) { _ex = ex; } }
public void GivenAnotherExistingMeasurementWithDate(string date) { _date = DateTime.Parse(date); _otherMeasurement = new Measurement(_LENGTH, _WEIGHT, _date); }
void before_op() { _measurement = new Measurement(NORMAL_LENGTH, NORMAL_WEIGHT, NORMAL_DATE); }
private void IWantToMakeANewMeasurementWithValidLengthAndValidWeightAndInValidDate() { try { _measurement = new Measurement(ValidLength, ValidWeight, DateTime.Parse(InvalidDate)); } catch (Exception ex) { _ex = ex; } }
private void anExistingMeasurement() { _measurement = new Measurement(_LENGTH, _WEIGHT, _DATE); }
public void GivenAnotherMeasurementObjectIsCreatedWithTheDateWhichIsAnEarlierDate(String date, String circumstance) { _otherMeasurement = new Measurement(NORMAL_LENGTH,NORMAL_WEIGHT, DateTime.Parse(date)); }
private void anExistingMeasurementWithLengthAndWeightAndDate(int length, int weight, String date) { _measurement = new Measurement(length, weight, DateTime.Parse(date)); }
public void GivenAValidUserWhichHasAValidMeasurement() { _measurementBuf = new Measurement(180, 75000, DateTime.Now); _person = new Person("1", new DateTime(1986, 5, 2), PersonDef.Gender.Male, _measurementBuf); }
public void addMeasurement(Measurement measurement) { if (measurement == null) { throw new ArgumentException("Measurement cannot be null"); } if (_measurements.Exists(e => e.date.Day == measurement.date.Day && e.date.Month == measurement.date.Month && e.date.Year == measurement.date.Year)) { throw new ArgumentException("A measurement for this moment is already registered"); } _isMeasurementsSorted = false; _measurements.Add(measurement); _isChanged = true; }
public void GivenAnExistingMeasurement() { _measurement = new Measurement(_LENGTH, _WEIGHT, _DATE); }
public void GivenAnotherMeasurementObjectIsCreatedWhichIsNull() { _otherMeasurement = null; }
public void GivenAnInvalidFirstMeasurementIsProvided() { _measurement = null; }
public void WhenITryToFetchTheMostRecentMeasurement() { _measurement = _person.getLastMeasurement(); }
public void GivenAValidStartingMeasurementIsProvided() { _measurement = new Measurement(180, 60000, DateTime.Now); }