Esempio n. 1
0
        public void Init()
        {
            _fakes = new AnalyzerFakes();
            Db     = _fakes.DbContext;
            Db.ForTests();
            UnityInstance.Offer(Db);

            _electionGuid = Guid.NewGuid();
            SessionKey.CurrentElectionGuid.SetInSession(_electionGuid);
            BallotTestHelper.SaveElectionGuidForTests(_electionGuid);

            SessionKey.CurrentComputer.SetInSession(new Computer
            {
                ComputerGuid = Guid.NewGuid(),
                ComputerCode = "TEST",
                ElectionGuid = _electionGuid
            });

            _samplePeople = new List <Person>
            {
                new Person {
                }.ForTests(),
                new Person {
                }.ForTests(),
                new Person {
                }.ForTests(),
                new Person {
                }.ForTests(),
                new Person {
                }.ForTests(),
            };
        }
Esempio n. 2
0
        public void Init()
        {
            _fakes = new AnalyzerFakes();
            Db     = _fakes.DbContext;
            Db.ForTests();
            UnityInstance.Offer(Db);

            _electionGuid = Guid.NewGuid();

            SessionKey.CurrentElectionGuid.SetInSession(_electionGuid);
            BallotTestHelper.SaveElectionGuidForTests(_electionGuid);

            SessionKey.CurrentComputer.SetInSession(new Computer
            {
                ComputerGuid = Guid.NewGuid(),
                ComputerCode = "TEST",
                ElectionGuid = _electionGuid
            });

            SamplePeople = new List <Person>
            {
                new Person {
                    FirstName = "a0", CombinedInfo = "abc", CombinedInfoAtStart = "abc", VotingMethod = VotingMethodEnum.InPerson
                }.ForTests(),
                new Person {
                    FirstName = "a1",
                }.ForTests(),
                new Person {
                    FirstName = "a2",
                }.ForTests(),
                new Person {
                    FirstName = "a3",
                }.ForTests(),
                new Person {
                    FirstName = "a4",
                }.ForTests(),
                new Person {
                    FirstName = "a5", IneligibleReasonGuid = IneligibleReasonEnum.Ineligible_Moved_elsewhere_recently
                }.ForTests(),
                new Person {
                    FirstName = "a6", IneligibleReasonGuid = IneligibleReasonEnum.IneligiblePartial1_Older_Youth
                }.ForTests(),
                new Person {
                    FirstName = "a7", IneligibleReasonGuid = IneligibleReasonEnum.Ineligible_Resides_elsewhere
                }.ForTests(),
            };
        }
        public void Init()
        {
            _fakes = new AnalyzerFakes();
            Db     = _fakes.DbContext;
            Db.ForTests();
            UnityInstance.Offer(Db);

            _electionGuid = Guid.NewGuid();
            SessionKey.CurrentElectionGuid.SetInSession(_electionGuid);
            BallotTestHelper.SaveElectionGuidForTests(_electionGuid);

            SessionKey.CurrentComputer.SetInSession(new Computer
            {
                ComputerGuid = Guid.NewGuid(),
                ComputerCode = "TEST",
                ElectionGuid = _electionGuid
            });

            _samplePeople = new List <Person>
            {// 0 - 7
                new Person {
                    FirstName = "x0", CombinedInfo = "person", VotingMethod = VotingMethodEnum.InPerson
                }.ForTests(),
                new Person {
                    FirstName = "x1", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x2", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x3", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x4", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x5", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x6", CombinedInfo = "person"
                }.ForTests(),
                new Person {
                    FirstName = "x7", CombinedInfo = "person"
                }.ForTests(),
            };
        }
Esempio n. 4
0
 public ResultCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 5
0
 public VoteCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 6
0
 public ElectionCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 7
0
 public TellerCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 8
0
 public BallotCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 9
0
 public LocationModel(ITallyJDbContext db) : base(db)
 {
 }
Esempio n. 10
0
        //private readonly Func<Result, Result> _addResult;
        //private readonly Func<ResultSummary, ResultSummary> _addResultSummary;
        //private readonly Func<ResultTie, ResultTie> _addResultTie;
        //private ITallyJDbContext dbContext;

        //public Savers()
        //{
        //  _isInTest = false;
        //}

        //public Savers(bool isInTest)
        //{
        //  _isInTest = isInTest;
        //}

        //public Savers(IAnalyzerFakes fakes)
        //{
        //  _addResult = fakes.AddResult;
        //  _addResultSummary = fakes.AddResultSummary;
        //  _addResultTie = fakes.AddResultTie;
        //  _isInTest = true;
        //}

        public Savers(ITallyJDbContext dbContext)
        {
            Db = dbContext;
        }
Esempio n. 11
0
 protected DataConnectedModel(ITallyJDbContext db)
 {
     _db = db;
 }
Esempio n. 12
0
 public LocationCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 13
0
 public PersonCacher(ITallyJDbContext dbContext) : base(dbContext)
 {
 }
Esempio n. 14
0
 public static void ForTests(this ITallyJDbContext context)
 {
     Db = context;
 }