Exemple #1
0
        public override bool Equals(object obj)
        {
            if (obj is VotePartition other)
            {
                if (VoteLines.Count != other.VoteLines.Count)
                {
                    return(false);
                }

                return(VoteLines.Zip(other.VoteLines, (a, b) => a.Equals(b)).All(z => z));
            }

            return(false);
        }
Exemple #2
0
        public void Add(VoteLine voteLine)
        {
            if (voteLine == null)
            {
                throw new ArgumentNullException(nameof(voteLine));
            }

            if (VoteLines.Count == 0)
            {
                PartitionType = voteLine.MarkerType;
            }
            else if (voteLine.MarkerType != PartitionType)
            {
                throw new ArgumentException($"Attempted to add a vote line of type {voteLine.MarkerType} to a partition of type {PartitionType}.");
            }

            VoteLines.Add(voteLine);
        }