Exemple #1
0
        public void GetAllStations()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);

            Assert.Equal(2, stationVerbindingRepository.GetAllPerrons().Count);
        }
Exemple #2
0
        public void UpdateStation()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);
            Perron perron = new Perron(1, "xx", true);

            Assert.True(stationVerbindingRepository.UpdatePerron(perron));
        }
Exemple #3
0
        public void DeletePerron()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);
            Perron perron = new Perron(1, "naam", false);

            Assert.True(stationVerbindingRepository.DeletePerron(perron.Id));
        }
Exemple #4
0
 public PerronController(IConfiguration configuration)
 {
     context          = new MSSQLPerronContext(configuration.GetConnectionString("DefaultConnection"));
     stationContext   = new MSSQLStationContext(configuration.GetConnectionString("DefaultConnection"));
     repo             = new PerronRepository(context);
     stationRepo      = new StationRepository(stationContext);
     converter        = new PerronViewModelConverter();
     stationConverter = new StationViewModelConverter();
 }
Exemple #5
0
        public void GetStationbyId()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);
            Perron perron = new Perron(2, "naam", true);

            Assert.Equal(perron.Id, stationVerbindingRepository.GetPerronbyId(2).Id);
            Assert.Equal(perron.Naam, stationVerbindingRepository.GetPerronbyId(2).Naam);
            Assert.Equal(perron.Actief, stationVerbindingRepository.GetPerronbyId(2).Actief);
        }
Exemple #6
0
        public void CreateStation()
        {
            EmptyLists();

            stationVerbindingRepository = new PerronRepository(context);
            Perron perron = new Perron(4, "naam", false);



            Assert.Equal(4, stationVerbindingRepository.CreatePerron(perron));
        }