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(), }; }
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(), }; }
public ResultCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public VoteCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public ElectionCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public TellerCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public BallotCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public LocationModel(ITallyJDbContext db) : base(db) { }
//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; }
protected DataConnectedModel(ITallyJDbContext db) { _db = db; }
public LocationCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public PersonCacher(ITallyJDbContext dbContext) : base(dbContext) { }
public static void ForTests(this ITallyJDbContext context) { Db = context; }