Пример #1
0
 public bool Equals(Vote otherObj)
 {
     return otherObj.MirId == this.MirId
             && otherObj.PartyId == this.PartyId
             && otherObj.Count == this.Count;
 }
Пример #2
0
 public bool Equals(Vote otherObj)
 {
     return(otherObj.MirId == this.MirId &&
            otherObj.PartyId == this.PartyId &&
            otherObj.Count == this.Count);
 }
Пример #3
0
        /// <summary>
        /// Parse Vote from Votes.txt
        /// ex:
        /// 1;1;1000
        /// 1;2;500
        /// 1;1000;600
        /// </summary>
        /// <param name="recordLine"></param>
        /// <returns></returns>
        public static Vote ParseVoteFromString(string recordLine)
        {
            if (string.IsNullOrEmpty(recordLine))
            {
                throw new ArgumentNullException();
            }

            var propValues = recordLine.Split(SEPARATOR);

            var item = new Vote(
                                mirId: int.Parse(propValues[0]),
                                partyId: int.Parse(propValues[1]),
                                count: int.Parse(propValues[2])
                           );

            return item;
        }
Пример #4
0
 public void Parse_Vote_From_String_Test()
 {
     string recordLine = "2;5;5500"; // TODO: Initialize to an appropriate value
     //2;5;5500
     //3;1;25678
     Vote expected = new Vote(2, 5, 5500); // TODO: Initialize to an appropriate value
     Vote actual;
     actual = InputParsers.ParseVoteFromString(recordLine);
     Assert.AreEqual(expected, actual);
 }