public void ProcessSingleTimeUnits() { var expected = "1 hour and 1 minute"; var estimatedTime = new EstimatedDuration(); Assert.Equal(expected, estimatedTime.GetEstimatedTime()); }
public void ShowOneMinute() { var expected = "1 minute"; var input = "0 hours and 1 minutes"; var estimatedTime = new EstimatedDuration(); Assert.Equal(expected, estimatedTime.GetEstimatedTime(input)); }
public void ShowingTheProperHoursWhenMinutesAreTen() { var expected = "3 hours and 10 minutes"; var input = "3 hours and 10 minutes"; var estimatedTime = new EstimatedDuration(); Assert.Equal(expected, estimatedTime.GetEstimatedTime(input)); }
public void NotShowHoursWhenZeroHours() { var expected = "45 minutes"; var input = "0 hours and 45 minutes"; var estimatedTime = new EstimatedDuration(); Assert.Equal(expected, estimatedTime.GetEstimatedTime(input)); }
public void NotShowMinutesWhenZeroMinutes() { var expected = "2 hours"; var estimatedTime = new EstimatedDuration(); var input = "2 hours and 0 minutes"; Assert.Equal(expected, estimatedTime.GetEstimatedTime(input)); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as CatalogEntry; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (TypeElement != null) { dest.TypeElement = (Code <Hl7.Fhir.Model.CatalogEntry.CatalogEntryType>)TypeElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.CatalogEntry.CatalogEntryStatus>)StatusElement.DeepCopy(); } if (EffectivePeriod != null) { dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy(); } if (OrderableElement != null) { dest.OrderableElement = (Hl7.Fhir.Model.FhirBoolean)OrderableElement.DeepCopy(); } if (ReferencedItem != null) { dest.ReferencedItem = (Hl7.Fhir.Model.ResourceReference)ReferencedItem.DeepCopy(); } if (RelatedEntry != null) { dest.RelatedEntry = new List <Hl7.Fhir.Model.CatalogEntry.RelatedEntryComponent>(RelatedEntry.DeepCopy()); } if (UpdatedBy != null) { dest.UpdatedBy = (Hl7.Fhir.Model.ResourceReference)UpdatedBy.DeepCopy(); } if (Note != null) { dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy()); } if (EstimatedDuration != null) { dest.EstimatedDuration = (Hl7.Fhir.Model.Duration)EstimatedDuration.DeepCopy(); } if (BillingCode != null) { dest.BillingCode = new List <Hl7.Fhir.Model.CodeableConcept>(BillingCode.DeepCopy()); } if (BillingSummaryElement != null) { dest.BillingSummaryElement = (Hl7.Fhir.Model.FhirString)BillingSummaryElement.DeepCopy(); } if (ScheduleSummaryElement != null) { dest.ScheduleSummaryElement = (Hl7.Fhir.Model.FhirString)ScheduleSummaryElement.DeepCopy(); } if (LimitationSummaryElement != null) { dest.LimitationSummaryElement = (Hl7.Fhir.Model.FhirString)LimitationSummaryElement.DeepCopy(); } if (RegulatorySummaryElement != null) { dest.RegulatorySummaryElement = (Hl7.Fhir.Model.FhirString)RegulatorySummaryElement.DeepCopy(); } return(dest); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (Number != null) { hashCode = hashCode * 59 + Number.GetHashCode(); } if (Url != null) { hashCode = hashCode * 59 + Url.GetHashCode(); } if (Actions != null) { hashCode = hashCode * 59 + Actions.GetHashCode(); } if (Building != null) { hashCode = hashCode * 59 + Building.GetHashCode(); } if (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (DisplayName != null) { hashCode = hashCode * 59 + DisplayName.GetHashCode(); } if (Duration != null) { hashCode = hashCode * 59 + Duration.GetHashCode(); } if (EstimatedDuration != null) { hashCode = hashCode * 59 + EstimatedDuration.GetHashCode(); } if (Executor != null) { hashCode = hashCode * 59 + Executor.GetHashCode(); } if (FullDisplayName != null) { hashCode = hashCode * 59 + FullDisplayName.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (KeepLog != null) { hashCode = hashCode * 59 + KeepLog.GetHashCode(); } if (QueueId != null) { hashCode = hashCode * 59 + QueueId.GetHashCode(); } if (Result != null) { hashCode = hashCode * 59 + Result.GetHashCode(); } if (Timestamp != null) { hashCode = hashCode * 59 + Timestamp.GetHashCode(); } if (BuiltOn != null) { hashCode = hashCode * 59 + BuiltOn.GetHashCode(); } if (ChangeSet != null) { hashCode = hashCode * 59 + ChangeSet.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if FreeStyleBuild instances are equal /// </summary> /// <param name="other">Instance of FreeStyleBuild to be compared</param> /// <returns>Boolean</returns> public bool Equals(FreeStyleBuild other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( Number == other.Number || Number != null && Number.Equals(other.Number) ) && ( Url == other.Url || Url != null && Url.Equals(other.Url) ) && ( Actions == other.Actions || Actions != null && Actions.SequenceEqual(other.Actions) ) && ( Building == other.Building || Building != null && Building.Equals(other.Building) ) && ( Description == other.Description || Description != null && Description.Equals(other.Description) ) && ( DisplayName == other.DisplayName || DisplayName != null && DisplayName.Equals(other.DisplayName) ) && ( Duration == other.Duration || Duration != null && Duration.Equals(other.Duration) ) && ( EstimatedDuration == other.EstimatedDuration || EstimatedDuration != null && EstimatedDuration.Equals(other.EstimatedDuration) ) && ( Executor == other.Executor || Executor != null && Executor.Equals(other.Executor) ) && ( FullDisplayName == other.FullDisplayName || FullDisplayName != null && FullDisplayName.Equals(other.FullDisplayName) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( KeepLog == other.KeepLog || KeepLog != null && KeepLog.Equals(other.KeepLog) ) && ( QueueId == other.QueueId || QueueId != null && QueueId.Equals(other.QueueId) ) && ( Result == other.Result || Result != null && Result.Equals(other.Result) ) && ( Timestamp == other.Timestamp || Timestamp != null && Timestamp.Equals(other.Timestamp) ) && ( BuiltOn == other.BuiltOn || BuiltOn != null && BuiltOn.Equals(other.BuiltOn) ) && ( ChangeSet == other.ChangeSet || ChangeSet != null && ChangeSet.Equals(other.ChangeSet) )); }
public string ProcessEstimatedDuration(string input) { var duration = new EstimatedDuration(); return(duration.GetEstimatedTime(input)); }