Пример #1
0
        public EntityStatesTest()
        {
            var dbContextFactory = new DbContextInMemoryFactory(nameof(EntityStatesTest));

            _schoolDbContextSut = dbContextFactory.Create();
            _schoolDbContextSut.Database.EnsureCreated();
        }
Пример #2
0
        public EntityTypesTest()
        {
            var dbContextFactory = new DbContextInMemoryFactory(DbName);

            _schoolDbContextSut = dbContextFactory.Create();
            _schoolDbContextSut.Database.EnsureCreated();
        }
Пример #3
0
 public PersonRepositoryTests()
 {
     _dbContextFactory = new DbContextInMemoryFactory(nameof(PersonRepositoryTests));
     using var dbx     = _dbContextFactory.CreateDbContext();
     dbx.Database.EnsureCreated();
     _personRepositorySUT = new PersonRepository(_dbContextFactory);
 }
Пример #4
0
        public RatingFacadeTests()
        {
            var dbContextFactory = new DbContextInMemoryFactory(nameof(ActorFacadeTest));
            var unitOfWork       = new UnitOfWork(dbContextFactory);

            repository = new Repository <RatingEntity>(unitOfWork);
            mapper     = new RatingMapper();

            facadeTestUnit = new RatingFacade(unitOfWork, repository, mapper);
        }
Пример #5
0
    protected DbContextTestsBase(ITestOutputHelper output)
    {
        XUnitTestOutputConverter converter = new(output);

        Console.SetOut(converter);

        DbContextFactory = new DbContextInMemoryFactory(GetType().Name, seedTestingData: true);
        // DbContextFactory = new DbContextLocalDBTestingFactory(GetType().FullName!, seedTestingData: true);

        CookBookDbContextSUT = DbContextFactory.CreateDbContext();
    }
Пример #6
0
        public AddressFacadeTests()
        {
            var dbContextFactory = new DbContextInMemoryFactory(nameof(AddressFacadeTests));
            var dbx = dbContextFactory.Create();

            dbx.Database.EnsureCreated();
            var unitOfWork = new UnitOfWork(dbx);

            _repository = new RepositoryBase <AddressEntity>(unitOfWork);
            _mapper     = new AddressMapper();
            var entityFactory = new EntityFactory(dbx.ChangeTracker);

            _facadeSUT = new AddressFacade(unitOfWork, _repository, _mapper, entityFactory);
        }
Пример #7
0
 public LinqLazyEvaluationTest()
 {
     _dbContextFactory   = new DbContextInMemoryFactory(nameof(EntityStatesTest));
     _schoolDbContextSut = _dbContextFactory.Create();
     _schoolDbContextSut.Database.EnsureCreated();
 }
Пример #8
0
 public FilmDatDbContextTests()
 {
     _dbContextFactory = new DbContextInMemoryFactory(nameof(FilmDatDbContext));
     _filmDatDbContext = _dbContextFactory.CreateDbContext();
     _filmDatDbContext.Database.EnsureCreated();
 }