private void SeedSectiiDeVotare(VoteMonitorContext context, int idJudet) { if (context.PollingStations.Any(a => a.IdCounty == idJudet)) { return; } context.PollingStations.AddRange( new PollingStation { Id = idJudet * 10 + 1, IdCounty = idJudet, AdministrativeTerritoryCode = $"Sectia {idJudet * 10 + 1}", Number = 1, TerritoryCode = $"Localitate {idJudet * 10 + 1}" }, new PollingStation { Id = idJudet * 10 + 2, IdCounty = idJudet, AdministrativeTerritoryCode = $"Sectia {idJudet * 10 + 2}", Number = 2, TerritoryCode = $"Localitate {idJudet * 10 + 2}" }, new PollingStation { Id = idJudet * 10 + 3, IdCounty = idJudet, AdministrativeTerritoryCode = $"Sectia {idJudet * 10 + 3}", Number = 3, TerritoryCode = $"Localitate {idJudet * 10 + 3}" }, new PollingStation { Id = idJudet * 10 + 4, IdCounty = idJudet, AdministrativeTerritoryCode = $"Sectia {idJudet * 10 + 4}", Number = 4, TerritoryCode = $"Localitate {idJudet * 10 + 4}" }, new PollingStation { Id = idJudet * 10 + 5, IdCounty = idJudet, AdministrativeTerritoryCode = $"Sectia {idJudet * 10 + 5}", Number = 5, TerritoryCode = $"Localitate {idJudet * 10 + 5}" } ); context.SaveChanges(); }
public Task <int> Handle(ImportObserversRequest message, CancellationToken token) { var pathToFile = message.FilePath; var counter = 0; var startId = GetMaxIdObserver(); using (var reader = File.OpenText(pathToFile)) { while (reader.Peek() >= 0) { var fileContent = reader.ReadLine(); var data = fileContent.Split('\t'); var hashed = _hashService.GetHash(data[1]); var observer = new Observer { Id = startId + counter, IdNgo = message.IdOng, Phone = data[0], Name = data[message.NameIndexInFile], Pin = hashed }; _context.Observers.Add(observer); counter++; } _context.SaveChanges(); } return(Task.FromResult(counter)); }
public async Task When_updating_county_by_nonexistent_id() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 2, Name = "Name2", Order = 3, NumberOfPollingStations = 2 }); context.Counties.Add(new County { Code = "Code3", Diaspora = true, Id = 3, Name = "Name3", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); var county = await countiesCommandHandler.Handle(new UpdateCounty(588, new UpdateCountyModel()), new CancellationToken(false)); county.IsFailure.ShouldBeTrue(); county.Error.ShouldBe("Could not find county with id = 588"); } }
public async Task When_loading_county_by_existent_id() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 2, Name = "Name2", Order = 3, NumberOfPollingStations = 2 }); context.Counties.Add(new County { Code = "Code3", Diaspora = true, Id = 3, Name = "Name3", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); var county = await countiesCommandHandler.Handle(new GetCounty(2), new CancellationToken(false)); county.IsSuccess.ShouldBeTrue(); var c2 = county.Value; c2.Id.ShouldBe(2); c2.Code.ShouldBe("Code2"); c2.Name.ShouldBe("Name2"); c2.NumberOfPollingStations.ShouldBe(2); c2.Diaspora.ShouldBe(true); c2.Order.ShouldBe(3); } }
private void SeedOngs(VoteMonitorContext context) { if (context.Ngos.Any()) { return; } context.Ngos.AddRange( new Domain.Ong.Models.Ngo { Id = 1, Name = "Denumire ONG A", ShortName = "ONG A" }, new Domain.Ong.Models.Ngo { Id = 2, Name = "Denumire ONG B", ShortName = "ONG B" }, new Domain.Ong.Models.Ngo { Id = 3, Name = "Denumire ONG C", ShortName = "ONG C" }, new Domain.Ong.Models.Ngo { Id = 4, Name = "Denumire ONG D", ShortName = "ONG D" }, new Domain.Ong.Models.Ngo { Id = 5, Name = "Denumire ONG E", ShortName = "ONG E" }, new Domain.Ong.Models.Ngo { Id = 6, Name = "Denumire ONG F", ShortName = "ONG F" } ); context.SaveChanges(); }
private void SetupContextWithPollingStations(IEnumerable <Entities.PollingStation> pollingStations) { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.PollingStations.AddRange(pollingStations); context.SaveChanges(); } }
private void SetupContextWithPollingStation(Entities.PollingStation pollingStation) { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.PollingStations.Add(pollingStation); context.SaveChanges(); } }
public async Task When_importing_counties_should_insert_records_for_nonexistent_ids_and_update_the_rest() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 3, Name = "Name2", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); StringBuilder sb = new StringBuilder("Id,Code,Name,NumberOfPollingStations,Diaspora,Order"); sb.Append(Environment.NewLine); sb.Append("1,Cluj,Cluuuuuuuuuj,1,TRUE,999"); sb.Append(Environment.NewLine); sb.Append("3,Iasi,Iasi The Best,13,False,5"); var buffer = Encoding.UTF8.GetBytes(sb.ToString()); var formFile = new FormFile(new MemoryStream(buffer), 0, buffer.Length, "Data", "dummy.csv"); var result = await countiesCommandHandler.Handle(new CreateOrUpdateCounties(formFile), new CancellationToken(false)); result.IsSuccess.ShouldBeTrue(); context.Counties.Count().ShouldBe(2); var counties = context.Counties.ToArray(); var clujCounty = counties[0]; clujCounty.Id.ShouldBe(1); clujCounty.Code.ShouldBe("Cluj"); clujCounty.Name.ShouldBe("Cluuuuuuuuuj"); clujCounty.NumberOfPollingStations.ShouldBe(1); clujCounty.Diaspora.ShouldBe(true); clujCounty.Order.ShouldBe(999); var iasiCounty = counties[1]; iasiCounty.Id.ShouldBe(3); iasiCounty.Code.ShouldBe("Iasi"); iasiCounty.Name.ShouldBe("Iasi The Best"); iasiCounty.NumberOfPollingStations.ShouldBe(13); iasiCounty.Diaspora.ShouldBe(false); iasiCounty.Order.ShouldBe(5); } }
public async Task When_loading_all_counties_should_return_them_ordered() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 2, Name = "Name2", Order = 3, NumberOfPollingStations = 2 }); context.Counties.Add(new County { Code = "Code3", Diaspora = true, Id = 3, Name = "Name3", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); var counties = await countiesCommandHandler.Handle(new GetCountiesForExport(), new CancellationToken(false)); counties.IsSuccess.ShouldBeTrue(); counties.Value.Count.ShouldBe(3); var c1 = counties.Value[0]; c1.Id.ShouldBe(3); c1.Code.ShouldBe("Code3"); c1.Name.ShouldBe("Name3"); c1.NumberOfPollingStations.ShouldBe(2); c1.Diaspora.ShouldBe(true); c1.Order.ShouldBe(1); var c2 = counties.Value[1]; c2.Id.ShouldBe(2); c2.Code.ShouldBe("Code2"); c2.Name.ShouldBe("Name2"); c2.NumberOfPollingStations.ShouldBe(2); c2.Diaspora.ShouldBe(true); c2.Order.ShouldBe(3); var c3 = counties.Value[2]; c3.Id.ShouldBe(1); c3.Code.ShouldBe("Code1"); c3.Name.ShouldBe("Name1"); c3.NumberOfPollingStations.ShouldBe(14); c3.Diaspora.ShouldBe(false); c3.Order.ShouldBe(12); } }
public Task <FormVersionCompleteModel> Handle(CreateOrUpdateFormRequest request, CancellationToken cancellationToken) { FormVersion formVersion = _mapper.Map <FormVersion>(request.ToCreateOrUpdate); if (request.isCreatingNew) { _context.FormVersions.Add(formVersion); } else { _context.Set <FormVersion>().Attach(formVersion); } _context.SaveChanges(); return(null); }
public async Task When_loading_2_counties_from_db_for_export() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 3, Name = "Name2", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); var exportResult = await countiesCommandHandler.Handle(new GetCountiesForExport(), new CancellationToken(false)); exportResult.IsSuccess.ShouldBeTrue(); exportResult.Value.Count.ShouldBe(2); exportResult.Value .FirstOrDefault(x => x.Code == "Code1" && x.Diaspora == false && x.Id == 1 && x.Name == "Name1" && x.Order == 12 && x.NumberOfPollingStations == 14) .ShouldNotBeNull(); exportResult.Value .FirstOrDefault(x => x.Code == "Code2" && x.Diaspora == true && x.Id == 3 && x.Name == "Name2" && x.Order == 1 && x.NumberOfPollingStations == 2) .ShouldNotBeNull(); } }
public async Task When_updating_county_by_existent_id() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 1, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.Counties.Add(new County { Code = "Code2", Diaspora = true, Id = 2, Name = "Name2", Order = 3, NumberOfPollingStations = 2 }); context.Counties.Add(new County { Code = "Code3", Diaspora = true, Id = 3, Name = "Name3", Order = 1, NumberOfPollingStations = 2 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); var updateCountyModel = new UpdateCountyModel() { Name = "Super Iasi", Code = "IS", Order = 33, Diaspora = false, NumberOfPollingStations = 767 }; var county = await countiesCommandHandler.Handle(new UpdateCounty(2, updateCountyModel), new CancellationToken(false)); county.IsSuccess.ShouldBeTrue(); context.Counties.Count().ShouldBe(3); var updatedCounty = await context.Counties.FirstOrDefaultAsync(x => x.Id == 2); updatedCounty.ShouldNotBeNull(); updatedCounty.Id.ShouldBe(2); updatedCounty.Code.ShouldBe("IS"); updatedCounty.Name.ShouldBe("Super Iasi"); updatedCounty.NumberOfPollingStations.ShouldBe(767); updatedCounty.Diaspora.ShouldBe(false); updatedCounty.Order.ShouldBe(33); } }
public async Task When_importing_counties_should_update_counties_by_id() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.Counties.Add(new County { Code = "Code1", Diaspora = false, Id = 3, Name = "Name1", Order = 12, NumberOfPollingStations = 14 }); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var countiesCommandHandler = new CountiesCommandHandler(context, _fakeLogger.Object, _mapper); StringBuilder sb = new StringBuilder("Id,Code,Name,NumberOfPollingStations,Diaspora,Order"); sb.Append(Environment.NewLine); sb.Append("3,Cluj,Cluuuuuuuuuj,1,TRUE,1"); var buffer = Encoding.UTF8.GetBytes(sb.ToString()); var formFile = new FormFile(new MemoryStream(buffer), 0, buffer.Length, "Data", "dummy.csv"); var result = await countiesCommandHandler.Handle(new CreateOrUpdateCounties(formFile), new CancellationToken(false)); result.IsSuccess.ShouldBeTrue(); context.Counties.Count().ShouldBe(1); var county = context.Counties.First(); county.Id.ShouldBe(3); county.Code.ShouldBe("Cluj"); county.Name.ShouldBe("Cluuuuuuuuuj"); county.NumberOfPollingStations.ShouldBe(1); county.Diaspora.ShouldBe(true); county.Order.ShouldBe(1); } }
public async Task Handler_WhenPollingStationExists_ReturnsTrue() { using (var context = new VoteMonitorContext(_dbContextOptions)) { context.PollingStations.Add(new PollingStationBuilder().WithId(3).Build()); context.SaveChanges(); } using (var context = new VoteMonitorContext(_dbContextOptions)) { var sut = new CheckPollingStationExistsHandler(context, _mockLogger.Object); var checkPollingStationExists = new CheckPollingStationExists() { Id = 3 }; var result = await sut.Handle(checkPollingStationExists, new CancellationToken()); result.Should().Be(true); } }
private void SeedObservatoriCuRaspunsuri(VoteMonitorContext context, int idOng) { if (context.Observers.Any(a => a.IdNgo == idOng)) { return; } var listaObservatori = new List <Observer> { new Observer { IdNgo = idOng, Name = "Popescu Florin", Phone = "0763000000", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Cremarenco Alin", Phone = "0763000001", FromTeam = false }, new Observer { IdNgo = idOng, Name = "Chivu Marin", Phone = "0763000002", FromTeam = false }, new Observer { IdNgo = idOng, Name = "Neacsu Andreea", Phone = "0763000004", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Stanciu Florina", Phone = "0763000003", FromTeam = false }, new Observer { IdNgo = idOng, Name = "Neacsu Andreea", Phone = "0763000004", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Duta Andrei", Phone = "0763000005", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Vlad George", Phone = "0763000007", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Pascu Dan", Phone = "0763000008", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Stan Stefan", Phone = "0763000010", FromTeam = true }, new Observer { IdNgo = idOng, Name = "Petrache Razvan", Phone = "0763000011", FromTeam = false }, new Observer { IdNgo = idOng, Name = "Dumbrava Valeria", Phone = "0763000009", FromTeam = true } }; context.Observers.AddRange(listaObservatori); var listaRaspunsuri = new List <Answer> { new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'A' * 20 + 1, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'A' * 20 + 8, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'A' * 20 + 13, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'B' * 20 + 2, IdPollingStation = 11, LastModified = DateTime.Now.AddMinutes(10) }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'B' * 20 + 5, IdPollingStation = 11, LastModified = DateTime.Now.AddMinutes(10) }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'B' * 20 + 9, IdPollingStation = 11, LastModified = DateTime.Now.AddMinutes(10) }, new Answer { IdObserver = listaObservatori[0].Id, IdOptionToQuestion = 'B' * 20 + 12, IdPollingStation = 11, LastModified = DateTime.Now.AddMinutes(10) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'A' * 20 + 2, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'A' * 20 + 4, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'A' * 20 + 7, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'A' * 20 + 11, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'C' * 20 + 2, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'C' * 20 + 5, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'C' * 20 + 9, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[1].Id, IdOptionToQuestion = 'C' * 20 + 12, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'A' * 20 + 3, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'A' * 20 + 4, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'A' * 20 + 8, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'A' * 20 + 10, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'C' * 20 + 2, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'C' * 20 + 4, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'C' * 20 + 8, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'C' * 20 + 12, IdPollingStation = 12, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'B' * 20 + 1, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'B' * 20 + 5, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'B' * 20 + 9, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[2].Id, IdOptionToQuestion = 'B' * 20 + 10, IdPollingStation = 13, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[3].Id, IdOptionToQuestion = 'A' * 20 + 1, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[3].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[3].Id, IdOptionToQuestion = 'A' * 20 + 8, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[3].Id, IdOptionToQuestion = 'A' * 20 + 13, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[4].Id, IdOptionToQuestion = 'A' * 20 + 1, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[4].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[4].Id, IdOptionToQuestion = 'A' * 20 + 8, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[4].Id, IdOptionToQuestion = 'A' * 20 + 13, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[5].Id, IdOptionToQuestion = 'B' * 20 + 1, IdPollingStation = 14, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[5].Id, IdOptionToQuestion = 'B' * 20 + 5, IdPollingStation = 14, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[5].Id, IdOptionToQuestion = 'B' * 20 + 8, IdPollingStation = 14, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[5].Id, IdOptionToQuestion = 'B' * 20 + 13, IdPollingStation = 14, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'A' * 20 + 2, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'A' * 20 + 4, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'A' * 20 + 7, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'A' * 20 + 11, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'B' * 20 + 2, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'B' * 20 + 5, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'B' * 20 + 9, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[6].Id, IdOptionToQuestion = 'B' * 20 + 12, IdPollingStation = 15, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'A' * 20 + 1, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(40) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(40) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'A' * 20 + 7, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(40) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'A' * 20 + 13, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(40) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'B' * 20 + 2, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'B' * 20 + 4, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'B' * 20 + 8, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[7].Id, IdOptionToQuestion = 'B' * 20 + 11, IdPollingStation = 25, LastModified = DateTime.Now.AddMinutes(-25) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'A' * 20 + 1, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'A' * 20 + 9, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'A' * 20 + 11, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(30) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 3, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 5, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 7, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 12, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'B' * 20 + 1, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'B' * 20 + 5, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'B' * 20 + 8, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'B' * 20 + 11, IdPollingStation = 22, LastModified = DateTime.Now.AddMinutes(20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 3, IdPollingStation = 23, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 6, IdPollingStation = 23, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 8, IdPollingStation = 23, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[8].Id, IdOptionToQuestion = 'C' * 20 + 12, IdPollingStation = 23, LastModified = DateTime.Now.AddMinutes(-20) }, new Answer { IdObserver = listaObservatori[9].Id, IdOptionToQuestion = 'C' * 20 + 1, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[9].Id, IdOptionToQuestion = 'A' * 20 + 5, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[9].Id, IdOptionToQuestion = 'A' * 20 + 9, IdPollingStation = 11, LastModified = DateTime.Now }, new Answer { IdObserver = listaObservatori[9].Id, IdOptionToQuestion = 'A' * 20 + 11, IdPollingStation = 11, LastModified = DateTime.Now }, }; context.Answers.AddRange(listaRaspunsuri); context.SaveChanges(); }