コード例 #1
0
		protected override void Establish_context()
		{
			base.Establish_context();
			Mocks.BackToRecordAll();
			Container = new AutoMockingContainer(Mocks);
			Container.Initialize();
			IoC.Initialize(Container);
		}
コード例 #2
0
 protected override void Establish_context()
 {
     base.Establish_context();
     Mocks.BackToRecordAll();
     Container = new AutoMockingContainer(Mocks);
     Container.Initialize();
     IoC.Initialize(Container);
 }
コード例 #3
0
 public virtual void Setup()
 {
     mocks = new MockRepository();
     container = new AutoMockingContainer(mocks);
     container.Initialize();
     mocksForContainerThatResolvesProperties = new MockRepository();
     containerThatResolvesProperties = new AutoMockingContainer(mocksForContainerThatResolvesProperties, true);
     containerThatResolvesProperties.Initialize();
 }
コード例 #4
0
 public virtual void Setup()
 {
     mocks     = new MockRepository();
     container = new AutoMockingContainer(mocks);
     container.Initialize();
     mocksForContainerThatResolvesProperties = new MockRepository();
     containerThatResolvesProperties         = new AutoMockingContainer(mocksForContainerThatResolvesProperties, true);
     containerThatResolvesProperties.Initialize();
 }
コード例 #5
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);
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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)));
        }
コード例 #8
0
 public void SetUp()
 {
     mocks = new MockRepository();
     container = new AutoMockingContainer(mocks);
     container.Initialize();
 }
コード例 #9
0
 protected void InitializeContainer()
 {
     mockery   = new MockRepository();
     container = new AutoMockingContainer(mockery);
     container.Initialize();
 }
 protected override void EstablishContext()
 {
     _autoMocker =  new AutoMockingContainer<TestClassWithAbstractClassDependency>();
 }
コード例 #11
0
 public void SetUp()
 {
     mocks     = new MockRepository();
     container = new AutoMockingContainer(mocks);
     container.Initialize();
 }
コード例 #12
0
        protected override SutFactory <T> CreateSut <T>()
        {
            var container = new AutoMockingContainer(new NSubstituteMockFactory());

            return(new SutFactory <T>(container));
        }
コード例 #13
0
 public TestFixtureBase()
 {
     Repository = new MockRepository();
     Container  = new AutoMockingContainer(Repository);
 }
コード例 #14
0
 public void SetUp()
 {
     _container = new AutoMockingContainer();
     _container.Initialize();
 }
 protected override void EstablishContext()
 {
     _autoMocker = new AutoMockingContainer <TestClassWithAbstractClassDependency>();
 }
コード例 #16
0
 public void SetUp()
 {
     _container = new AutoMockingContainer();
       _container.Initialize();
 }
コード例 #17
0
 /// <summary>
 /// Creats a new instance of the <see cref="InstanceContextSpecification{TSystemUnderTest}"/>.
 /// </summary>
 protected InstanceContextSpecification()
 {
     _autoMockingContainer = new AutoMockingContainer <TSystemUnderTest>();
 }