Пример #1
0
        /// <summary>
        /// Tests equivalency
        /// </summary>
        /// <param name="dta"></param>
        /// <returns></returns>
        public bool Equals(Dta dta)
        {
            if (dta == null)
            {
                throw new ArgumentNullException(nameof(dta));
            }
            bool ret = true;

            if (Distance != dta.Distance)
            {
                ret = false;
            }
            else if (Type != dta.Type)
            {
                ret = false;
            }
            else if (Threshhold != dta.Threshhold)
            {
                ret = false;
            }
            else if (Tolerance != dta.Tolerance)
            {
                ret = false;
            }
            else if (TrimWidth != dta.TrimWidth)
            {
                ret = false;
            }
            else if (UseMM != dta.UseMM)
            {
                ret = false;
            }
            return(ret);
        }
 /// <summary>
 /// Comparison result object
 /// </summary>
 /// <param name="dta">DTA parameters used as part of the </param>
 /// <param name="totalCount">Total number of indicies able to be compared</param>
 /// <param name="totalCompared">Total number of comparisons made where the values of the source were above minimum restrictions</param>
 /// <param name="totalFailed">total number of comparisons that failed dta</param>
 /// <exception cref="totalCount">Total count smaller than comparisons reported</exception>
 /// <exception cref="totalCompared">Total comparisons smaller than failures reported</exception>
 public SingleComparison(Dta dta, int totalCount, int totalCompared, int totalFailed)
 {
     Dta           = dta ?? throw new ArgumentNullException(nameof(dta));
     TotalCount    = totalCount;
     TotalCompared = totalCompared;
     TotalFailed   = totalFailed;
     if (TotalCount < TotalCompared)
     {
         throw new ArgumentException("totalCount less than comparisons made");
     }
     if (TotalCompared < TotalFailed)
     {
         throw new ArgumentException("totalCompared less than failures");
     }
 }
Пример #3
0
 /// <summary>
 /// Comparison result object
 /// </summary>
 /// <param name="dta">DTA parameters used as part of the </param>
 /// <param name="totalCount">Total number of indicies able to be compared</param>
 /// <param name="totalCompared">Total number of comparisons made where the values of the source were above minimum restrictions</param>
 /// <param name="totalFailed">total number of comparisons that failed dta</param>
 /// <exception cref="ArgumentException">Impossible number of failures or comparisons were made</exception>
 public SingleComparison(Dta dta, int totalCount, int totalCompared, int totalFailed)
 {
     Dta           = dta ?? throw new ArgumentNullException(nameof(dta));
     TotalCount    = totalCount;
     TotalCompared = totalCompared;
     TotalFailed   = totalFailed;
     if (TotalCount < TotalCompared)
     {
         throw new ArgumentException(Resources.compMessageMalformedResult);
     }
     if (TotalCompared < TotalFailed)
     {
         throw new ArgumentException(Resources.compMessageMalformedResult);
     }
 }