Beispiel #1
0
        public static void ClassInitialize(TestContext tc)
        {
            var options = new DbContextOptionsBuilder <CMSTechnicalContext>().UseInMemoryDatabase(databaseName: "CMSTechnical").Options;

            _context = new CMSTechnicalContext(options);

            _context.User.Add(new User {
                Username = "******"
            });
            _context.User.Add(new User {
                Username = "******"
            });
            _context.User.Add(new User {
                Username = "******"
            });
            _context.User.Add(new User {
                Username = "******"
            });

            _context.SaveChanges();

            _controller = new UsersController(_context);
        }
Beispiel #2
0
 public UsersController(CMSTechnicalContext context)
 {
     _context = context;
 }