protected override void Establish_context() { base.Establish_context(); Mocks.BackToRecordAll(); Container = new AutoMockingContainer(Mocks); Container.Initialize(); IoC.Initialize(Container); }
public virtual void Setup() { mocks = new MockRepository(); container = new AutoMockingContainer(mocks); container.Initialize(); mocksForContainerThatResolvesProperties = new MockRepository(); containerThatResolvesProperties = new AutoMockingContainer(mocksForContainerThatResolvesProperties, true); containerThatResolvesProperties.Initialize(); }
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); }
public void BaseSetup() { _overrides = new Dictionary <Type, object>(); _raisers = new Dictionary <Type, IEventRaiser>(); _mocks = new MockRepository(); _container = new AutoMockingContainer(_mocks); _eventsToVerify.Clear(); _currentEventId = 0; SetupContainer(); _container.Initialize(); _container.PrepareForServices(); _container.Start(); _target = null; BeforeEachTest(); }
public async Task ContextWithWrongModel_OnActionExecutionAsync_CreateBadRequestResult() { //arrange var productValidationFilter = new ProductValidationFilter(new List <INameValidator>(), new List <IDescriptionValidator>()); var autoMockContainer = AutoMockingContainer.GetNew(); var context = GenerateActionExecutingContext(autoMockContainer); context.ModelState.AddModelError("test", "test_error"); var next = new ActionExecutionDelegate(() => null); //act await productValidationFilter.OnActionExecutionAsync(context, next); //assert Assert.That(context.Result.GetType(), Is.EqualTo(typeof(BadRequestObjectResult))); }
public void SetUp() { mocks = new MockRepository(); container = new AutoMockingContainer(mocks); container.Initialize(); }
protected void InitializeContainer() { mockery = new MockRepository(); container = new AutoMockingContainer(mockery); container.Initialize(); }
protected override void EstablishContext() { _autoMocker = new AutoMockingContainer<TestClassWithAbstractClassDependency>(); }
protected override SutFactory <T> CreateSut <T>() { var container = new AutoMockingContainer(new NSubstituteMockFactory()); return(new SutFactory <T>(container)); }
public TestFixtureBase() { Repository = new MockRepository(); Container = new AutoMockingContainer(Repository); }
public void SetUp() { _container = new AutoMockingContainer(); _container.Initialize(); }
protected override void EstablishContext() { _autoMocker = new AutoMockingContainer <TestClassWithAbstractClassDependency>(); }
/// <summary> /// Creats a new instance of the <see cref="InstanceContextSpecification{TSystemUnderTest}"/>. /// </summary> protected InstanceContextSpecification() { _autoMockingContainer = new AutoMockingContainer <TSystemUnderTest>(); }