Пример #1
0
        // Use TestCleanup to run code after each test has run
        public void Dispose()
        {
            _context.Database.EnsureDeleted();

            _context.Dispose();
            _context = null;
        }
Пример #2
0
        public EntitiesTests()
        {
            var builder = new DbContextOptionsBuilder();
            builder.UseSqlite($"Filename=DynamicLinqTestDb_{Guid.NewGuid()}.db");

            _context = new BlogContext(builder.Options);
            _context.Database.EnsureDeleted();
            _context.Database.EnsureCreated();
        }