public void EqualityTests()
        {
            var x = new EnvironmentType("AAAA", "BBBB", 0, "A1111", "A2222", "A3333");
            var y = new EnvironmentType("AAAA", "BBBB", 1000, "A1111", "A2222", "A3333");
            var z = new EnvironmentType("BBBB", "BBBB", 1000, "A1111", "A2222", "A3333");

            Assert.True(x == y);
            Assert.False(y == z);
            Assert.False(x == z);
            Assert.True(x.Equals(y));
            Assert.False(y.Equals(z));
            Assert.False(x.Equals(z));
        }
Esempio n. 2
0
        /// <summary>
        /// Returns true if PipelineExecutionStepState instances are equal
        /// </summary>
        /// <param name="other">Instance of PipelineExecutionStepState to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PipelineExecutionStepState other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     StepId == other.StepId ||
                     StepId != null &&
                     StepId.Equals(other.StepId)
                 ) &&
                 (
                     PhaseId == other.PhaseId ||
                     PhaseId != null &&
                     PhaseId.Equals(other.PhaseId)
                 ) &&
                 (
                     Action == other.Action ||
                     Action != null &&
                     Action.Equals(other.Action)
                 ) &&
                 (
                     Repository == other.Repository ||
                     Repository != null &&
                     Repository.Equals(other.Repository)
                 ) &&
                 (
                     Branch == other.Branch ||
                     Branch != null &&
                     Branch.Equals(other.Branch)
                 ) &&
                 (
                     Environment == other.Environment ||
                     Environment != null &&
                     Environment.Equals(other.Environment)
                 ) &&
                 (
                     EnvironmentType == other.EnvironmentType ||
                     EnvironmentType != null &&
                     EnvironmentType.Equals(other.EnvironmentType)
                 ) &&
                 (
                     StartedAt == other.StartedAt ||
                     StartedAt != null &&
                     StartedAt.Equals(other.StartedAt)
                 ) &&
                 (
                     FinishedAt == other.FinishedAt ||
                     FinishedAt != null &&
                     FinishedAt.Equals(other.FinishedAt)
                 ) &&
                 (
                     Details == other.Details ||
                     Details != null &&
                     other.Details != null &&
                     Details.SequenceEqual(other.Details)
                 ) &&
                 (
                     Status == other.Status ||

                     Status.Equals(other.Status)
                 ) &&
                 (
                     Links == other.Links ||
                     Links != null &&
                     Links.Equals(other.Links)
                 ));
        }