static IoCContainer InitContainerForIntegrationTests() { var container = new IoCContainer(); container.Add(typeof(IDatabase), new RealDatabase()); container.Add(typeof(IThirdPartyService), new FakeThirdPartyService()); return container; }
public CustomConvention() { container = InitContainerForIntegrationTests(); Classes .Where(type => type.IsInNamespace(GetType().Namespace)) .NameEndsWith("Tests"); Methods .Where(method => method.IsVoid()); ClassExecution .CreateInstancePerTestClass(UsingContainer) .SortCases((caseA, caseB) => String.Compare(caseA.Name, caseB.Name, StringComparison.Ordinal)); }
public CustomConvention() { container = InitContainerForIntegrationTests(); Classes .Where(type => type.IsInNamespace(GetType().Namespace)) .NameEndsWith("Tests"); Cases = new MethodFilter() .Where(method => method.Void()) .ZeroParameters(); ClassExecution .CreateInstancePerTestClass(UsingContainer); }
public CustomConvention() { container = InitContainerForIntegrationTests(); Classes .InTheSameNamespaceAs(typeof(CustomConvention)) .NameEndsWith("Tests"); Methods .Where(method => method.IsVoid()); ClassExecution .CreateInstancePerClass() .UsingFactory(GetFromContainer) .SortCases((caseA, caseB) => String.Compare(caseA.Name, caseB.Name, StringComparison.Ordinal)); }