public void CreateOtionsList()
 {
     Options = LocationRepo.GetAllLocations().Select(a =>
                                                     new SelectListItem
     {
         Value = a.Id.ToString(),
         Text  = a.Address
     }).ToList();
 }
Esempio n. 2
0
        public void TestCheckLocationExistsTrue()
        {
            // Arrange
            var optionsBuilder = new DbContextOptionsBuilder <Project1Context>();

            optionsBuilder.UseSqlServer(SecretConfiguration.ConnectionString);
            var options = optionsBuilder.Options;

            using (var dbContext = new Project1Context(options))
            {
                ILocationRepo p0Repo    = new LocationRepo(dbContext);
                var           locations = p0Repo.GetAllLocations();
                // Act and Assert
                Assert.True(p0Repo.CheckLocationExists(locations.ToList().First().Id));
            }
        }