Beispiel #1
0
        public RecipeRepositoryTests(RecipeRepositoryTestsFixture recipeRepositoryTestsFixture, ITestOutputHelper output)
        {
            var converter = new XUnitTestOutputConverter(output);

            Console.SetOut(converter);
            this._recipeRepositoryTestsFixture = recipeRepositoryTestsFixture;

            this._recipeRepositoryTestsFixture.PrepareDatabase();
        }
        public RecipeRepositoryTests(ITestOutputHelper output)
        {
            XUnitTestOutputConverter converter = new XUnitTestOutputConverter(output);

            Console.SetOut(converter);

            _dbContextFactory           = new DbContextInMemoryFactory(nameof(RecipeRepositoryTests));
            using CookBookDbContext dbx = _dbContextFactory.CreateDbContext();
            dbx.Database.EnsureCreated();

            _repositorySUT = new RecipeRepository(_dbContextFactory);
        }