Ejemplo n.º 1
0
 public TimedHostedService(
     ISomeService service,
     ILogger <TimedHostedService> logger)
 {
     _service = service;
     _logger  = logger;
 }
        public MainViewModel(ISomeService someService, IPersonService personService)
        {
            _personService = personService;
            _someService   = someService;

            Execute();
        }
Ejemplo n.º 3
0
 public override void AwakeFromNib()
 {
     if (Site == null || !Site.DesignMode)
     {
         service = MyIoCContainer.Get <ISomeService>();
     }
 }
Ejemplo n.º 4
0
        public MainActor(ISomeService someService, IChildCreatorActor childCreatorActor)
        {
            this.someService       = someService;
            this.childCreatorActor = childCreatorActor;

            Receive <bool>((x) => SendMessage(x));
        }
        public DataboundDatagridItemCreatorForm(ISomeService someService)
        {
            _view = new DataboundDatagridItemCreatorFormView();

            var someText   = LocalValueFieldBuilder.Build(_view.SomeText, Validator.IsNotNullRef);
            var someNumber = LocalValueFieldBuilder.BuildNullableInt(_view.SomeNumber, Validator.IsNotNull, Validator.MustBePositive <int>());
            var someBool   = LocalValueFieldBuilder.Build(_view.SomeBool);

            _view.SomeTrait.PermittedValues = EnumExtensions.GetEnumValues <SomeTraitType>().Select(x => (SomeTraitType?)x);
            var someTrait = LocalValueFieldBuilder.Build(_view.SomeTrait, Validator.IsNotNull);

            var createProduct = RemoteActionBuilder.Build(_view.CreateAction,
                                                          () => someService.Create(
                                                              new SomeDto {
                SomeNumber = someNumber.Value.GetValueOrDefault(),
                SomeText   = someText.Value,
                SomeBool   = someBool.Value,
                SomeTrait  = someTrait.Value.Value
            }),
                                                          x => {
                CreatedItem = x;
                Ended?.Invoke(this, Outcome.Created);
            });

            var isFormValid = new AggregatedErrorsValue <bool>(false, self => !self.Errors.Any(), x => {
                x.Observes(someText);
                x.Observes(someNumber);
                x.Observes(someBool);
                x.Observes(someTrait);
            });

            createProduct.BindEnableAndInitialize(isFormValid);
        }
Ejemplo n.º 6
0
 public DataboundDatagridProgram(ISomeService someService)
 {
     _datagrid    = new DataboundDatagridForm();
     _fetchData   = new RemoteActionsCallerForm(o => o.Add(someService.FetchItems, x => _datagrid.Items.Items.Replace(x)));
     _itemCreator = new DataboundDatagridItemCreatorForm(someService);
     _itemEditor  = new DataboundDatagridItemEditorForm(someService);
 }
Ejemplo n.º 7
0
 public Main(ISomeService someService, IOutput output)
 {
     Assert.NotNull(someService, nameof(someService));
     Assert.NotNull(output, nameof(output));
     m_someService = someService;
     m_output      = output;
 }
Ejemplo n.º 8
0
 public ValuesController(ILogger <ValuesController> logger, IHttpContextAccessor httpContextAccessor, ISomeService someService)
 {
     _logger = logger;
     _httpContextAccessor    = httpContextAccessor;
     _traceIdentifierService = ServiceLocator.ServiceProvider.GetService <ITraceIdentifierService>();
     _someService            = someService;
 }
 public MyController(IntPtr handle) : base(handle)
 {
     if (Site == null || !Site.DesignMode)
     {
         service = MyIoCContainer.Get <ISomeService>();
     }
 }
Ejemplo n.º 10
0
 public TestClass2(ISomeInstance someInstance, string testProperty1, ISomeService someService, string testProperty3)
 {
     this.InjectedService = someService;
     this.TestProperty1   = testProperty1;
     this.TestProperty2   = someInstance;
     this.TestProperty3   = testProperty3;
 }
Ejemplo n.º 11
0
        public void ShouldIgnoreArgumentsOnGenericCallWhenTypeIsStruct()
        {
            // setup
            MockRepository mocks             = new MockRepository();
            ISomeService   m_SomeServiceMock = mocks.StrictMock <ISomeService>();
            SomeClient     sut = new SomeClient(m_SomeServiceMock);

            using (mocks.Ordered())
            {
                Expect.Call(delegate
                {
                    m_SomeServiceMock.DoSomething <string>(null, null);
                });
                LastCall.IgnoreArguments();

                Expect.Call(delegate
                {
                    m_SomeServiceMock.DoSomething <DateTime>(null, default(DateTime));                     // can't use null here, because it's a value type!
                });
                LastCall.IgnoreArguments();
            }
            mocks.ReplayAll();

            // test
            sut.DoSomething();

            // verification
            mocks.VerifyAll();

            // cleanup
            m_SomeServiceMock = null;
            sut = null;
        }
Ejemplo n.º 12
0
 public SomeController(ILogger <SomeController> logger, IValidator <SomeRequest> someValidator,
                       ISomeService someService)
 {
     _logger        = logger;
     _someValidator = someValidator;
     _someService   = someService;
 }
Ejemplo n.º 13
0
 public HomeController(Service1 service1, Service2 service2, Service3 service3, ISomeService someService)
 {
     _service1    = service1;
     _service2    = service2;
     _service3    = service3;
     _someService = someService;
 }
        public void SimpleExpectationSetUp_BindingInputWithMultipleParametersToReturnValue_InvocationValuesAreAccessibleWhenStubbingMessage()
        {
            MsmqHelpers.Purge("shippingservice");
            var service = Configure.Stub().NServiceBusSerializers().WcfEndPoints().Create(@".\Private$\orderservice");

            var proxy = service.WcfEndPoint <ISomeService>("http://localhost:9101/something");

            proxy.Setup(s => s.IHaveMultipleInputParameters(Parameter.Any <string>(), Parameter.Equals <string>(str => str == "snappy"), Parameter.Any <bool>())).Returns <string, string, bool>((param1, param2, param3) => param1)
            .Send <IOrderWasPlaced, string>((msg, product) => { msg.OrderedProduct = product; }, "shippingservice");

            service.Start();

            string firstRequestReturnValue;

            using (var factory = new ChannelFactory <ISomeService>(new BasicHttpBinding(), "http://localhost:9101/something"))
            {
                ISomeService channel = factory.CreateChannel();

                firstRequestReturnValue = channel.IHaveMultipleInputParameters("hello", "snappy", false);
            }

            service.Dispose();

            Assert.That(MsmqHelpers.PickMessageBody("shippingservice"), Is.StringContaining("hello"));
            Assert.That(firstRequestReturnValue, Is.EqualTo("hello"));
        }
        public void SimpleExpectationSetUp_BindingInputWithMultipleParametersToReturnValue2_InvocationValuesArePassedToReturn()
        {
            var service = Configure.Stub().NServiceBusSerializers().WcfEndPoints().Create(@".\Private$\orderservice");

            var proxy = service.WcfEndPoint <ISomeService>("http://localhost:9101/something");

            proxy.Setup(s => s.IHave4InputParameters(Parameter.Any <string>(), Parameter.Equals <string>(str => str == "snappy"), Parameter.Any <bool>(), Parameter.Any <string>())).Returns <string, string, bool, string>((param1, param2, param3, param4) =>
                                                                                                                                                                                                                            new FourInputParamsReturnValue {
                ReturnOne = param1, ReturnTwo = param2, ReturnThree = param3, ReturnFour = param4
            });

            service.Start();

            FourInputParamsReturnValue retVal;

            using (var factory = new ChannelFactory <ISomeService>(new BasicHttpBinding(), "http://localhost:9101/something"))
            {
                ISomeService channel = factory.CreateChannel();

                retVal = channel.IHave4InputParameters("hello", "snappy", false, "poppy");
            }

            service.Dispose();

            Assert.That(retVal.ReturnOne, Is.EqualTo("hello"));
        }
        public void SimpleExpectationSetUp_BindingInputToReturnValueByName_InvocationValuesArePassedToReturn()
        {
            var service = Configure.Stub().NServiceBusSerializers().WcfEndPoints().Create(@".\Private$\orderservice");

            var proxy = service.WcfEndPoint <ISomeService>("http://localhost:9101/something");

            proxy.Setup(s => s.IHave4InputParameters(Parameter.Any <string>(), Parameter.Any <string>(), Parameter.Any <bool>(), Parameter.Any <string>())).Returns <string>(fallback => new FourInputParamsReturnValue {
                ReturnOne = fallback
            });

            service.Start();

            FourInputParamsReturnValue actual;

            using (var factory = new ChannelFactory <ISomeService>(new BasicHttpBinding(), "http://localhost:9101/something"))
            {
                ISomeService channel = factory.CreateChannel();

                actual = channel.IHave4InputParameters("john doe", "somewhere", false, "to this");
            }

            service.Dispose();

            Assert.That(actual.ReturnOne, Is.EqualTo("to this"));
        }
Ejemplo n.º 17
0
        public BusinessLogic(ISomeService someService, ISyncPolicy policy)
        {
            _someService = someService;
            _policy      = policy;

            Log.Information("BusinessLogic ctor done");
        }
        public void RegisterAndResolve()
        {
            IServiceProvider provider    = GetServiceProvider();
            ISomeService     someService = provider.GetService <ISomeService>();

            Assert.NotNull(someService);
            Assert.IsType <SomeService>(someService);
        }
        public void Run()
        {
            ISomeService service = DependencyService.Resolve <ISomeService>();

            int number = service.AddNumbers(1, 2);

            service.DoImportantJob(number);
        }
    public MainViewModel(ISomeService someService, IPersonService personService)
    {
        _personService = personService;
        _someService   = someService;
        Name           = "Slim Shady";

        Execute();
    }
Ejemplo n.º 21
0
        public SecondPageViewModel(ISomeService someService, INavigationService navigationService)
        {
            _someService       = someService;
            _navigationService = navigationService;

            DoAnything         = new DelegateCommand(InvokeDoAnything);
            NavigateToMainPage = new DelegateCommand(async() => await InvokeNavigateToMainPage());
        }
Ejemplo n.º 22
0
 public SampleEntityPipelineService(IPluginExecutionContextAccessor executionContextAccessor, ILogger logger,
                                    IOrganizationService organizationService, ISettingsProvider settingsProvider, ISomeService someService) :
     base(executionContextAccessor, logger)
 {
     _organizationService = organizationService;
     _settingsProvider    = settingsProvider;
     _someService         = someService;
 }
Ejemplo n.º 23
0
 public QueueTimeless(ISomeService someService)
 {
     _someService     = someService;
     _internalPipline = new BlockingCollection <Packet <TItem> >();
     _cancellation    = new CancellationTokenSource();
     _currentPacket   = new Packet <TItem>(maxSize);
     _monitor         = StartQueue();
 }
Ejemplo n.º 24
0
        public static async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get")]
            HttpRequest req, ILogger log, ISomeService someService)
        {
            log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");

            return(new OkObjectResult(someService.GetSomeOption()));
        }
Ejemplo n.º 25
0
 public UploaderDemoFlow(ISomeService someService, IHttpRequester httpRequester)
 {
     _fetchFiles = new RemoteActionsCallerForm(x => x.Add(
                                                   someService.OrderAttachmentGetFiles,
                                                   y => _files = y));
     _demo   = new UploaderDemoForm(httpRequester);
     _params = new UploaderDemoParamsForm();
     _params.SetParent(_demo.GetUploadControl());
 }
Ejemplo n.º 26
0
 public ValuesController(
     ISomeService service,
     IAnotherService anotherService,
     ILogger <ValuesController> logger)
 {
     _service        = service;
     _anotherService = anotherService;
     _logger         = logger;
 }
Ejemplo n.º 27
0
        public static ISomeService Factory(Container c)
        {
            // Register the service by type...
            c.RegisterAutoWiredType(typeof(SomeService), ReuseScope.Hierarchy);
            // ... and force auto-wiring to happen.
            ISomeService result = (ISomeService)c.TryResolve(typeof(SomeService));

            return(result);
        }
Ejemplo n.º 28
0
        public void UseSomeServiceImpl()
        {
            IWindsorContainer container = new WindsorContainer();

            container.Register(Component.For <ISomeService>().ImplementedBy <SomeServiceImpl>());
            container.Register(Component.For <ISomeInnerService>().ImplementedBy <SomeInnerServiceImpl>());
            ISomeService service = container.Resolve <ISomeService>();

            Assert.IsNotNull(service);
        }
Ejemplo n.º 29
0
        public TestViewModel(ISomeService someService)
        {
            _id          = someService.GetRandomInt();
            ClickCommand = new ActionCommand(OnClickCommandExecute);
            // MessageBox.Show("wow" +_id);

            TextToShow = _id.ToString();

            TextToShow = "sadsads";
        }
Ejemplo n.º 30
0
        public async Task InvokeAsync(HttpContext context, ISomeService service)
        {
            context.Response.OnStarting(() =>
            {
                service.SetHeader(context.Response);
                return(Task.CompletedTask);
            });

            await _next.Invoke(context);
        }
        public MainViewModel(ISomeService someService)
        {
            receiver = new UdpSocketReceiver();
          
            receiver.MessageReceived += OnMessageReceived;


            Messages = new ObservableCollection<UDPMessage>();

            Task.Run(() => Init().Wait());

        }
Ejemplo n.º 32
0
 public SomeClient(ISomeService someSvc)
 {
     m_SomeSvc = someSvc;
 }
Ejemplo n.º 33
0
 public DIActor(string id, IActorRuntime runtime, ISomeService service) : base(id, runtime)
 {
     this.service = service;
 }
Ejemplo n.º 34
0
 public AMoreComplexService()
 {
     _dependentService = new SomeService();
 }
 public TestClass2NonMatchingName(
     ISomeInstance someInstance,
     string nonMatchingTestProperty1,
     ISomeService someService,
     string nonMatchingTestProperty3)
 {
     this.InjectedService = someService;
     this.TestProperty1 = nonMatchingTestProperty1;
     this.TestProperty2 = someInstance;
     this.TestProperty3 = nonMatchingTestProperty3;
 }
Ejemplo n.º 36
0
 private static async Task<string> SomeFuncAsync(ISomeService someTasks)
 {
     var response = await someTasks.FirstTaskAsync();
     
     return await someTasks.SecondTaskAsync(response);
 }
Ejemplo n.º 37
0
 public SomeServiceProxy()
 {
     _someService = new SomeService();
 }
Ejemplo n.º 38
0
 public DIActor(ISomeService service)
 {
     this.service = service;
 }
 public TestClass2(ISomeInstance testProperty2, string testProperty1, ISomeService someService, string testProperty3)
 {
     this.InjectedService = someService;
     this.TestProperty3 = testProperty3;
     this.TestProperty1 = testProperty1;
     this.TestProperty2 = testProperty2;
 }
Ejemplo n.º 40
0
 public ProductsController(IMediator mediator, ISomeService someService)
 {
     _mediator = mediator;
     _someService = someService;
 }