Ejemplo n.º 1
0
 public static TestAggregate FromSnapshot(TestAggregateSnapshot snapshot, ITestDependency dep)
 {
     return(new TestAggregate(snapshot.Id, dep)
     {
         Value = snapshot.Value
     });
 }
Ejemplo n.º 2
0
 public ChildTestActor(ITestDependency testDependency)
 {
     Instances.Add(this);
     TestDependency   = testDependency;
     ContextReference = Context;
     Receive <Start>(s => Sender.Tell(s));
 }
Ejemplo n.º 3
0
 public Migration_003(ITestDependency testDependency)
 {
     if (testDependency == null)
     {
         throw new NullReferenceException();
     }
 }
Ejemplo n.º 4
0
 public HomeController(ITestDependency testDependency,
     IContentStorageProvider contentStorageProvider,
     IContentManager contentManager)
 {
     _testDependency = testDependency;
     _contentStorageProvider = contentStorageProvider;
     _contentManager = contentManager;
 }
Ejemplo n.º 5
0
 public ModuleWithTwoDependencies(ITestDependency dependency, ITestDependency2 dependency2)
     : base("/2dependencies")
 {
     Get["/"] = _ =>
     {
         return(string.Format("Data of dependencies: {0}, {1}", dependency.GetData(), dependency2.GetData()));
     };
 }
Ejemplo n.º 6
0
 public HomeController(ITestDependency testDependency,
     IContentManager contentManager,
     IEventNotifier eventNotifier)
 {
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventNotifier = eventNotifier;
 }
Ejemplo n.º 7
0
 public HomeController(ITestDependency testDependency,
                       IContentStorageProvider contentStorageProvider,
                       IContentManager contentManager)
 {
     _testDependency         = testDependency;
     _contentStorageProvider = contentStorageProvider;
     _contentManager         = contentManager;
 }
Ejemplo n.º 8
0
 public ModuleWithOneDependency(ITestDependency dependency)
     : base("/1dependency")
 {
     Get["/"] = _ =>
     {
         return(string.Format("Data of dependency: {0}", dependency.GetData()));
     };
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScannerControllerWithDependencyInjection"/> class.
 /// </summary>
 public ScannerControllerWithDependencyInjection(IChromelyLogger logger, ITestDependency dependency)
 {
     _logger     = logger;
     _dependency = dependency;
     RegisterGetRequest("/scannercontroller/get1", Get1);
     RegisterGetRequest("/scannercontroller/get2", Get2);
     RegisterPostRequest("/scannercontroller/save", Save);
 }
Ejemplo n.º 10
0
 public HomeController(ITestDependency testDependency,
                       IContentManager contentManager,
                       IEventNotifier eventNotifier)
 {
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventNotifier  = eventNotifier;
 }
Ejemplo n.º 11
0
        public TestSut(ITestDependency testDependency)
        {
            if (testDependency == null)
            {
                throw new ArgumentNullException("testDependency");
            }

            this._testDependency = testDependency;
        }
Ejemplo n.º 12
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IEventBus eventBus,
     ISession session) {
     _session = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventBus = eventBus;
     }
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            if (this.InnerDependency != null)
            {
                var dep = this.InnerDependency as IDisposable;
                if (dep != null)
                {
                    dep.Dispose();
                }

                this.InnerDependency = null;
            }
        }
Ejemplo n.º 14
0
            public TestMessageHandler(IBus bus, ITestDependency testDependency)
            {
                if (bus == null)
                {
                    throw new ArgumentNullException("bus");
                }
                if (testDependency == null)
                {
                    throw new ArgumentNullException("testDependency");
                }

                _bus            = bus;
                _testDependency = testDependency;
            }
Ejemplo n.º 15
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IEventBus eventBus,
     IShapeFactory shapeFactory,
     IShapeDisplay shapeDisplay,
     ISession session)
 {
     _session        = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventBus       = eventBus;
     _shapeDisplay   = shapeDisplay;
     Shape           = shapeFactory;
 }
Ejemplo n.º 16
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IEventBus eventBus,
     IShapeFactory shapeFactory,
     IShapeDisplay shapeDisplay,
     ISession session)
 {
     _session = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventBus = eventBus;
     _shapeDisplay = shapeDisplay;
     Shape = shapeFactory;
 }
Ejemplo n.º 17
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IShapeFactory shapeFactory,
     ISession session,
     ILogger <HomeController> logger,
     ITagCache tagCache,
     IContentItemDisplayManager contentDisplay)
 {
     _session        = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     Shape           = shapeFactory;
     _logger         = logger;
     _tagCache       = tagCache;
     _contentDisplay = contentDisplay;
 }
Ejemplo n.º 18
0
        public async Task Should_resolve_arguments_When_action_has_parameters()
        {
            // Arrange
            var arrangeObject = new TestDependency();

            var             expectedByType      = arrangeObject;
            ITestDependency expectedByInterface = arrangeObject;
            TestDependency  actualByType        = null;
            ITestDependency actualByInterface   = null;

            var arrangeAction = new Action <TestDependency, ITestDependency>(
                (
                    byType,
                    byInterface) =>
            {
                actualByType      = byType;
                actualByInterface = byInterface;
            });

            var mockServices = new Mock <IServiceProvider>();

            mockServices
            .Setup(instance => instance.GetService(typeof(TestDependency)))
            .Returns(expectedByType)
            .Verifiable();

            mockServices
            .Setup(instance => instance.GetService(typeof(ITestDependency)))
            .Returns(expectedByInterface)
            .Verifiable();

            var arrangeServices = mockServices.Object;

            var arrangeInvocationContext = this.CreateInvocationContext();
            var arrangeInvoker           = this.CreateInvokerInstance(arrangeAction, arrangeServices);

            // Act
            await arrangeInvoker.InvokeAsync(arrangeInvocationContext, CancellationToken.None);

            // Assert
            mockServices.Verify();

            Assert.Same(expectedByType, actualByType);
            Assert.Same(expectedByInterface, actualByInterface);
        }
Ejemplo n.º 19
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IEventBus eventBus,
     IShapeFactory shapeFactory,
     IShapeDisplay shapeDisplay,
     ISession session,
     ILogger<HomeController> logger,
     ITagCache tagCache)
 {
     _session = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventBus = eventBus;
     _shapeDisplay = shapeDisplay;
     Shape = shapeFactory;
     _logger = logger;
     _tagCache = tagCache;
 }
Ejemplo n.º 20
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IShapeFactory shapeFactory,
     ISession session,
     ILogger <HomeController> logger,
     ITagCache tagCache,
     IContentItemDisplayManager contentDisplay,
     IDeferredTaskEngine processingQueue)
 {
     _deferredTaskEngine = processingQueue;
     _session            = session;
     _testDependency     = testDependency;
     _contentManager     = contentManager;
     Shape           = shapeFactory;
     _logger         = logger;
     _tagCache       = tagCache;
     _contentDisplay = contentDisplay;
 }
Ejemplo n.º 21
0
 public HomeController(
     ITestDependency testDependency,
     IContentManager contentManager,
     IEventBus eventBus,
     IShapeFactory shapeFactory,
     IShapeDisplay shapeDisplay,
     ISession session,
     ILogger<HomeController> logger,
     ITagCache tagCache,
     IContentItemDisplayManager contentDisplay,
     IDeferredTaskEngine processingQueue)
 {
     _deferredTaskEngine = processingQueue;
     _session = session;
     _testDependency = testDependency;
     _contentManager = contentManager;
     _eventBus = eventBus;
     _shapeDisplay = shapeDisplay;
     Shape = shapeFactory;
     _logger = logger;
     _tagCache = tagCache;
     _contentDisplay = contentDisplay;
 }
Ejemplo n.º 22
0
 public TestLogger(Point location = default(Point), ITestDependency dependency = null)
 {
     Name       = nameof(TestLogger);
     Location   = location;
     Dependency = dependency;
 }
 public ConstructorInjectionIntent(ITestDependency testDependency)
 {
     _testDependency = testDependency;
 }
Ejemplo n.º 24
0
        public void Execute(int number, ITestDependency d)
        {
            var dependencyUseResult = d.Do(number);

            Emit(new[] { new TestDomainEvent(dependencyUseResult, Id) });
        }
Ejemplo n.º 25
0
 public HomeController(ITestDependency testDependency)
 {
     _testDependency = testDependency;
 }
Ejemplo n.º 26
0
 public TestServiceInjectedOnly(ITestDependency dep)
 {
     this.InjectedDepedency = dep;
 }
 public TestAggregatesCommandHandler(ITestDependency testDependency)
 {
     Map <TestCommand>((c, a) => a.Execute(c.Parameter, testDependency));
     Map <TestCommandB>((c, a) => a.ExecuteWithOwnedDependency(c.Parameter));
 }
Ejemplo n.º 28
0
 public TestDependent(ITestDependency dependency)
 {
     _dependency = dependency;
 }
Ejemplo n.º 29
0
 public TestRemotingSerializationProviderWithParameters(
     ITestDependency dependency)
 {
     this.Dependency = dependency;
 }
 public TestClassWithConstructorWithDependency(ITestDependency dependency)
 {
     Dependency = dependency;
 }
Ejemplo n.º 31
0
 internal TestAggregate(string id, ITestDependency d) : base(id)
 {
     _testDependency = d;
 }
Ejemplo n.º 32
0
 public TestLogic(ITestDependency dependency)
 {
     this.dependency = dependency;
 }
Ejemplo n.º 33
0
 public TestObjectOneDependency(ITestDependency dependency)
 {
     Dependency = dependency;
 }
 public TestClassWithAnUninjectableConstructor(ITestDependency dependency)
 {
     Dependency = dependency;
 }
Ejemplo n.º 35
0
 public TestObjectTwoDependencies(ITestDependency dependency, ITestDependency2 dependency2)
 {
     _dependency1 = dependency;
     _dependency2 = dependency2;
 }
 public CompositeDependecy(ITestDependency internalDependecy)
 {
     this.InnerDependency = internalDependecy;
 }
Ejemplo n.º 37
0
 public HomeController(ITestDependency testDependency) {
     _testDependency = testDependency;	       
 }
Ejemplo n.º 38
0
 public TestServiceFlavor2(ITestDependency dep, string factoryParam1)
 {
     this.InjectedDepedency = dep;
     this.FacotoryParam     = factoryParam1;
 }
 public TestService(ITestDependency testDependency) { }
 public TestReceiver(Point location = default(Point), ITestDependency dependency = null)
     : base(nameof(TestReceiver))
 {
     Location   = location;
     Dependency = dependency;
 }
 public TestRemotingImplementationWithParameters(
     ITestDependency dependency)
 {
     this.Dependency = dependency;
 }
 public TestClassWithTwoConstructorsWithDependencies(ITestDependency dependency)
 {
     Dependency = dependency;
 }
 public ModuleWithTwoDependencies(ITestDependency dependency, ITestDependency2 dependency2)
     : base("/2dependencies")
 {
     Get["/"] = _ =>
     {
         return string.Format("Data of dependencies: {0}, {1}", dependency.GetData(), dependency2.GetData());
     };
 }
 public TestClassWithTwoConstructorsWithDependencies(ITestDependency dependency, ITestSecondDependency secondDependency)
 {
     Dependency = dependency;
     SecondDependency = secondDependency;
 }
Ejemplo n.º 45
0
 public TestListener(ITestDependency testDependency)
 {
     _testDependency = testDependency;
 }
 public ModuleWithOneDependency(ITestDependency dependency)
     : base("/1dependency")
 {
     Get["/"] = _ =>
     {
         return string.Format("Data of dependency: {0}", dependency.GetData());
     };
 }