Exemple #1
0
 public void Validate()
 {
     ValidationChecks.CannotBeNullOrEmpty(nameof(Id), Id);
     ValidationChecks.CannotBeNullOrEmpty(nameof(RecordString), RecordString);
     ValidationChecks.CannotBeNull(nameof(RecordDateTime), RecordDateTime);
     ValidationChecks.CannotBeNull(nameof(RecordOrdinal), RecordOrdinal);
 }
Exemple #2
0
        private void ValidateDischargeValues()
        {
            if (string.IsNullOrEmpty(StageUnits))
            {
                ThrowIfNotNull(nameof(StageAtStart), StageAtStart);
                ThrowIfNotNull(nameof(StageAtEnd), StageAtEnd);
            }

            ValidationChecks.CannotBeNull(nameof(Discharge), Discharge);
            ValidationChecks.CannotBeNullOrEmpty(nameof(DischargeUnits), DischargeUnits);
            ValidationChecks.CannotBeNullOrEmpty(nameof(ChannelName), ChannelName);
            ValidationChecks.CannotBeNullOrEmpty(nameof(WidthUnits), WidthUnits);
            ValidationChecks.CannotBeNullOrEmpty(nameof(AreaUnits), AreaUnits);
            ValidationChecks.CannotBeNullOrEmpty(nameof(VelocityUnits), VelocityUnits);
        }
Exemple #3
0
        public void Validate()
        {
            ValidationChecks.CannotBeNullOrEmpty(nameof(LocationIdentifier), LocationIdentifier);

            if (Discharge.HasValue)
            {
                ValidateDischargeValues();
            }
            else
            {
                ValidateEmptyDischarge();
            }

            ValidateReading();

            ThrowIfNoDischargeOrReadings();

            ValidationChecks
            .MustBeAValidInterval(nameof(MeasurementStartDateTime), MeasurementStartDateTime,
                                  nameof(MeasurementEndDateTime), MeasurementEndDateTime);
        }