Пример #1
0
 public SubObjectTwo(ISecondService secondService)
 {
     if (secondService == null)
     {
         throw new ArgumentNullException("secondService");
     }
 }
        public void MarshalOtherServiceTest()
        {
            ISecondService service     = Simply.Do[ConfigKey].Resolve <ISecondService>();
            IFailService   serviceFail = service.GetOtherService(123);

            serviceFail.FailInt().Should().Be(84);
        }
Пример #3
0
        public ViewModel(ISecondService secondService)
        {
            _secondService = secondService;

            _canStart    = true;
            StartCommand = new RelayCommand(async() => await Start(), () => _canStart);
        }
        public void SerializeComplexType()
        {
            ISecondService service = Simply.Do[ConfigKey].Resolve <ISecondService>();

            service.GetComplexType().Oi.Should().Be("whatever");
            service.GetComplexType().Tchau.Should().Be(42);
        }
Пример #5
0
        public void Test1()
        {
            CAbstract cAbstract = AutoFacContainer.Resolve <CAbstract>();
            string    d00       = cAbstract.Do();
            string    d01       = cAbstract.Rule.Validate();

            IAutoService autoService = AutoFacContainer.Resolve <IAutoService>();
            string       b00         = autoService.ShowAuto();

            ATest  atest = AutoFacContainer.Resolve <ATest>();
            string c00   = atest.title();

            var    service = AutoFacContainer.Resolve <IService>();
            string add     = service.Do();
            var    add01   = AutoFacContainer.ResolveNamed <IService>(typeof(FirstModel).Name);
            var    add02   = AutoFacContainer.ResolveNamed <IService>(typeof(FirstModel2).Name);


            ISecondService service2 = AutoFacContainer.Resolve <ISecondService>();
            string         add2     = service2.SecondDo();
            string         add22    = service2.Do();

            ThirdModel service3 = AutoFacContainer.Resolve <ThirdModel>();
            string     add3     = service3.Do();
        }
Пример #6
0
 public SubObjectTwo(ISecondService secondService)
 {
     if (secondService == null)
     {
         throw new ArgumentNullException(nameof(secondService));
     }
 }
 public MultipleParameters(IFirstService firstService, ISecondService secondService, IThirdService thirdService,
                           IFourthService fourthService)
 {
     _firstService  = firstService;
     _secondService = secondService;
     _thirdService  = thirdService;
     _fourthService = fourthService;
 }
        public FirstService(ISecondService secondService, IThirdService thirdService)
        {
            _secondService = secondService;
            _secondService.SecondMethod();

            _thirdService = thirdService;
            _thirdService.ThirdMethod();
        }
 public void TestManyCalls()
 {
     for (int i = 0; i < 50; i++)
     {
         Simply.Do.Log(this).DebugFormat("Running {0}...", i);
         ISecondService service = Simply.Do[ConfigKey].Resolve <ISecondService>();
         service.OtherString().Should().Be("42");
     }
 }
 public WeatherForecastController(ILogger <WeatherForecastController> logger,
                                  IFirstService firstService,
                                  ISecondService secondService,
                                  IThirdService thirdService,
                                  IFifthService fifthService,
                                  ISeventhService seventhService,
                                  IServiceScopeFactory serviceScopeFactory)
 {
     _logger                   = logger;
     this._firstService        = firstService;
     this._thirdService        = thirdService;
     this._fifthService        = fifthService;
     this._secondService       = secondService;
     this._seventhService      = seventhService;
     this._serviceScopeFactory = serviceScopeFactory;
 }
        public void TestPostFailConnectState()
        {
            bool ex = false;

            try
            {
                IFailService service = Simply.Do[ConfigKey].Resolve <IFailService>();
                service.FailInt();
            }
            catch (Exception)
            {
                ex = true;
            }

            ex.Should().Be.True();
            ISecondService service2 = Simply.Do[ConfigKey].Resolve <ISecondService>();

            service2.OtherString().Should().Be("42");
        }
Пример #12
0
        public Complex1(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            System.Threading.Interlocked.Increment(ref counter);
        }
Пример #13
0
        public Complex2(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            System.Threading.Interlocked.Increment(ref counter);
        }
Пример #14
0
        public Complex(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            Instances++;
        }
Пример #15
0
        public Complex2(
            IFirstService firstService,
            ISecondService secondService,
            IThirdService thirdService,
            ISubObjectOne subObjectOne,
            ISubObjectTwo subObjectTwo,
            ISubObjectThree subObjectThree)
        {
            if (firstService == null)
            {
                throw new ArgumentNullException("firstService");
            }

            if (secondService == null)
            {
                throw new ArgumentNullException("secondService");
            }

            if (thirdService == null)
            {
                throw new ArgumentNullException("thirdService");
            }

            if (subObjectOne == null)
            {
                throw new ArgumentNullException("subObjectOne");
            }

            if (subObjectTwo == null)
            {
                throw new ArgumentNullException("subObjectTwo");
            }

            if (subObjectThree == null)
            {
                throw new ArgumentNullException("subObjectThree");
            }

            Instances++;
        }
        public void ConnectToSecondServiceTest()
        {
            ISecondService service = Simply.Do[ConfigKey].Resolve <ISecondService>();

            service.OtherString().Should().Be("42");
        }
Пример #17
0
 public FooService(Lazy <IService> service, ISecondService secondService)
 {
     _service       = service;
     _secondService = secondService;
 }
Пример #18
0
 public FooController(Lazy <IService> service, ISecondService secondService)
 {
     _service       = service;
     _secondService = secondService;
 }
Пример #19
0
 public CompositionService(IFirstService firstService, ISecondService secondService)
 {
 }
 public SecondController(ISecondService secondService)
 {
     _secondService = secondService;
 }
 public FacadeService(IFirstService firstService, ISecondService secondService)
 {
     _firstService  = firstService;
     _secondService = secondService;
 }
Пример #22
0
 public ServiceController(IFirstService firstService, ISecondService secondService, IHttpClientFactory httpClientFactory)
 {
     _httpClientFactory = httpClientFactory;
 }
 public FirstService(dotnetContext dotnetContext, ISecondService secondService)
 {
     this._dotnetContext = dotnetContext;
     this._secondService = secondService;
 }