Exemplo n.º 1
0
        private BallotStatus GetTestBallotStatus()
        {
            var status = new BallotStatus
            {
                TrackingId          = "track id 1",
                ApproximateCastTime = DateTime.Parse("1/1/2001"),
                Details             = new List <string> {
                    "Counted"
                },
                Location = "location 1",
                Status   = BallotCountStatus.Counted
            };

            return(status);
        }
Exemplo n.º 2
0
        public static BallotStatusEntity ToBallotStatusEntity(this BallotStatus status)
        {
            if (status is null)
            {
                return(null);
            }

            var rowKey = status.ToBallotStatusRowKey();

            return(new BallotStatusEntity
            {
                RowKey = rowKey,
                PartitionKey = rowKey.ToBallotStatusPartitionKey(),
                TrackingId = status.TrackingId,
                ApproximateCastTime = status.ApproximateCastTime,
                Location = status.Location
            });
        }
Exemplo n.º 3
0
 public static string ToBallotStatusRowKey(this BallotStatus ballotStatus)
 {
     return(ballotStatus?.TrackingId.ToBallotStatusKeyFormat());
 }
Exemplo n.º 4
0
 public Ballot(IEnumerable <BallotField> fields)
 {
     id      = Guid.NewGuid().ToString();
     _fields = fields;
     status  = BallotStatus.untouched;
 }
Exemplo n.º 5
0
        public void ToBallotStatusRowKey_NullBallotStatus()
        {
            BallotStatus status = null;

            Assert.IsNull(status.ToBallotStatusRowKey());
        }
Exemplo n.º 6
0
        public void ToBallotStatusEntity_NullBallotStatus()
        {
            BallotStatus status = null;

            Assert.IsNull(status.ToBallotStatusEntity());
        }