Ejemplo n.º 1
0
        public static T GetMock <T>(this BaseTestFixture fixture)
        {
            var container =
                fixture.GetFromTestContext <AutoMockingContainer>(AutoMockingContainerHelper.ContainerKey);

            return(container.GetFirstCreatedMock <T>());
        }
Ejemplo n.º 2
0
        public static T ResolveWithAutomock <T>(this BaseTestFixture fixture, IDictionary arguments)
        {
            var container =
                fixture.GetFromTestContext <AutoMockingContainer>(AutoMockingContainerHelper.ContainerKey);

            return(container.Resolve <T>(arguments));
        }
Ejemplo n.º 3
0
 public void SetUp( BaseTestFixture fixture )
 {
     IIdentity identity=new GenericIdentity( UserName );
     IPrincipal principal=new GenericPrincipal( identity, Groups );
     originalPrincipal=Thread.CurrentPrincipal;
     Thread.CurrentPrincipal=principal;
 }
Ejemplo n.º 4
0
        public void ScenarioSetup()
        {
            _scope = ThreadScopedLifestyle.BeginScope(Container);

            AuthFixture?.ConfigureTestUser(Container, GetFeatureTenantId());

            BaseTestFixture.ScenarioSetup();
        }
Ejemplo n.º 5
0
        public void AfterEachScenario()
        {
            BaseTestFixture.ScenarioTearDown();

            Log.Warning("Scope is about to be disposed. Feature={FeatureTitle}, {ThreadId}; ", _featureContext.FeatureInfo.Title, Thread.CurrentThread.ManagedThreadId);
            _scope.Dispose();
            _scope = null;
            Container.Dispose();
            Container = null;
        }
Ejemplo n.º 6
0
        public void SetUp(BaseTestFixture fixture)
        {
            AutoMockingContainer container = new AutoMockingContainer();
             fixture.SetIntoTestContext(AutomockContainer, container);
             //fixture.DisposeAtTheEndOfTest(IoC.OverrideEngine(new CastleIoC(container)));
             fixture.DisposeAtTheEndOfTest( IoC.Container );

             if (SutType != null)
            container.Register(Component.For(SutType).LifeStyle.Transient);
        }
Ejemplo n.º 7
0
 public static void SetupInvoiceFixture(this BaseTestFixture btf)
 {
     if (!initialized)
     {
         NcqrsEnvironment.Configure(new StructureMapConfiguration(
                                        x =>
         {
             x.For <ICommandService>().Use(InitCommandService());
             x.For <ICustomerRepository>().Use(new FakeCustomerRepository());
             x.For <ITaxRepository>().Use(new FakeTaxRepository());
         }
                                        ));
         initialized = true;
     }
 }
Ejemplo n.º 8
0
        public void InitializeContainer()
        {
            Container = new Container();
            ConfigureContainer();

            RegisterContainerInSpecFlow(Container);
            RegisterSpecFlowTransforms();

            RegisterMinimalInfrastructureDependencies(Container);
            RegisterAssemblyBootstrappers();

            RegisterFeatureService(Container);
            RegisterNullEventPublisher(Container);

            BaseTestFixture = CreateAndRegisterTestFixtureIfNeeded(TestRunFixtureBase.Target);
            AuthFixture     = CreateAndRegisterAuthFixtureIfNeeded();

            AuthFixture?.ConfigureTestUserRole(Container);
            BaseTestFixture.RegisterScenarioDependencies(Container);
        }
Ejemplo n.º 9
0
        public void SetUp(BaseTestFixture fixture)
        {
            AutoMockingContainer container = new AutoMockingContainer();

            fixture.DisposeAtTheEndOfTest(container);
            fixture.SetIntoTestContext(ContainerKey, container);
            foreach (var type in Types)
            {
                container.Register(Component
                                   .For(type)
                                   .ImplementedBy(type)
                                   .LifeStyle.Transient);
            }
            container.ResolveProperties = ResolveProperties;
            if (IgnoreDependencies != null)
            {
                foreach (var ignoreDependency in IgnoreDependencies)
                {
                    container.DependencyToIgnore.Add(ignoreDependency);
                }
            }
        }
Ejemplo n.º 10
0
 public RatingServiceTests(BaseTestFixture fixture) : base(fixture)
 {
     this.ratingService = fixture.Provider.GetService(typeof(IRatingService)) as IRatingService;
     this.SeedData();
 }
Ejemplo n.º 11
0
 public MockStateProvider(BaseTestFixture fixture)
 {
     Fixture = fixture;
     Initialize();
 }
Ejemplo n.º 12
0
 public void SetUp(BaseTestFixture fixture)
 {
 }
 public MockFileExistenceChecker(BaseTestFixture fixture, bool doesExist)
 {
     DoesExist  = doesExist;
     FileMapper = new MockFileMapper(fixture);
 }
Ejemplo n.º 14
0
 public MockPartLoader(BaseTestFixture fixture, string mockPartFilePath) : base(null)
 {
     MockPartFilePath = mockPartFilePath;
 }
 public AuthenticationControllerTests()
 {
     _fixture = new BaseTestFixture();
 }
Ejemplo n.º 16
0
 public CalculaJurosControllerIntegrationTest(BaseTestFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 17
0
 public QuoteServiceTests(BaseTestFixture fixture) : base(fixture)
 {
     this.quoteService = fixture.Provider.GetService(typeof(IQuoteService)) as IQuoteService;
     this.SeedData();
 }
Ejemplo n.º 18
0
 public void FixtureSetUp(BaseTestFixture fixture)
 {
 }
Ejemplo n.º 19
0
 public MockUrlCreator(BaseTestFixture executingTestFixture) : base(false)
 {
     ExecutingTestFixture = executingTestFixture;
     Initialize();
 }
Ejemplo n.º 20
0
 public void TearDown(BaseTestFixture fixture)
 {
 }
Ejemplo n.º 21
0
 public MockControlLoader(BaseTestFixture fixture) : base(null)
 {
     Fixture = fixture;
 }
Ejemplo n.º 22
0
 public static AutoMockingContainer AutoMockingContainer(this BaseTestFixture fixture)
 {
     return
         (fixture.GetFromTestContext <AutoMockingContainer>(AutoMockingContainerHelper.ContainerKey));
 }
Ejemplo n.º 23
0
 public ValuesControllerIntegrationTest(BaseTestFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 24
0
 public MockDb4oDataProviderInitializer(BaseTestFixture executingTestFixture)
 {
     ExecutingTestFixture = executingTestFixture;
 }
 public MoviesControllerTest(BaseTestFixture fixture) : base(fixture)
 {
     _moviesRepositoryMock = new Mock <IMoviesRepository>();
     _movieTestsFixture    = new MovieTestsFixture();
     _movieService         = new MoviesService(_moviesRepositoryMock.Object);
 }
 public MockProjectionScanner(BaseTestFixture fixture) : base(null)
 {
     ControlLoader = new MockControlLoader(fixture);
 }
Ejemplo n.º 27
0
 public void TearDown(BaseTestFixture fixture)
 {
     fixture.RemoveFromTestContext(AutomockContainer);
 }
 public void TearDown(BaseTestFixture fixture)
 {
     ProfilerInfrastructure.FlushAllMessages();
 }
Ejemplo n.º 29
0
 public void Setup()
 {
     _baseTestFixture = new BaseTestFixture();
 }
Ejemplo n.º 30
0
 public MockControlLoader(BaseTestFixture fixture, string mockControlFilePath) : base(null)
 {
     MockControlFilePath = mockControlFilePath;
     Fixture             = fixture;
 }
Ejemplo n.º 31
0
 public UsersControllerIntegrationTest(BaseTestFixture fixture, ITestOutputHelper testOutput) : base(fixture)
 {
     this.testOutput = testOutput;
 }
Ejemplo n.º 32
0
 public void FixtureTearDown(BaseTestFixture fixture)
 {
 }
Ejemplo n.º 33
0
 public TokenControllerTest(BaseTestFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 34
0
 public BookshelfServiceTests(BaseTestFixture fixture) : base(fixture)
 {
     this.bookshelfService = fixture.Provider.GetService(typeof(IBookshelfService)) as IBookshelfService;
     this.SeedData();
 }
 public PeopleControllerIntegrationTest(BaseTestFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 36
0
 public void TearDown( BaseTestFixture fixture )
 {
     Thread.CurrentPrincipal=originalPrincipal;
 }
Ejemplo n.º 37
0
 public GlobalExceptionHandlerTest(BaseTestFixture fixture) : base(fixture)
 {
 }
 public void SetUp(BaseTestFixture fixture)
 {
     HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
 }