public void AddRepository_T() { var services = new ServiceCollection(); var builder = new ScorpioDbContextOptionsBuilder <TestDbContext>(services); Should.NotThrow(() => builder.AddRepository <TestTable, EfCoreRepository <TestDbContext, TestTable> >()); }
public void SetDefaultRepository() { var services = new ServiceCollection(); var builder = new ScorpioDbContextOptionsBuilder <TestDbContext>(services); Should.Throw <ScorpioException>(() => builder.SetDefaultRepository(typeof(object))); Should.NotThrow(() => builder.SetDefaultRepository(typeof(EfCoreRepository <, ,>))); }
public void UseMemoryCache() { var services = new ServiceCollection(); var builder = new ScorpioDbContextOptionsBuilder <TestDbContext>(services); var b = new DbContextOptionsBuilder <TestDbContext>(); Should.NotThrow(() => builder.UseMemoryCache(null)); b.Options.Extensions.IsNullOrEmpty(); builder.OptionsActions.ForEach(a => a(b)); b.Options.Extensions.ShouldHaveSingleItem(); }