private static void CreateNewContainerAndDbContext() { if (TestDependencyScope.IsInitialized()) { TestDependencyScope.End(); TestDependencyScope.Begin(); } }
private static void ResetDatabase() { var checkpoint = new Checkpoint { SchemasToExclude = new[] { "RoundhousE" }, TablesToIgnore = new[] { "sysdiagrams", "ApplicationStatus", } }; checkpoint.Reset(TestDependencyScope.Resolve <Func <IDbConnection> >()().ConnectionString).GetAwaiter().GetResult(); }
public void Execute(TestClass testClass) { TestingIoC.Initialize(); TestDependencyScope.Begin(); ResetDatabase(); var fixture = new Fixture(); AutoFixtureParameterSource.CustomizeAutoFixture(fixture); var instance = new SpecimenContext(fixture).Resolve(testClass.Type); testClass.RunCases(@case => { @case.Execute(instance); }); TestDependencyScope.End(); instance.Dispose(); }
public static object Resolve(Type type) { return(TestDependencyScope.Resolve(type)); }
public static T Resolve <T>() { return(TestDependencyScope.Resolve <T>()); }