コード例 #1
0
        public ActionResult Other()
        {
            var someOtherService = new SomeOtherService();

            someOtherService.DoSomething();
            return(Json(true));
        }
コード例 #2
0
    public Response DoSomething(string projectId)
    {
        string baseUrl = SomeOtherService.GetBaseUrlByProjectId(projectId);
        var    client  = _factory.CreateClient(baseUrl);

        return(client.GetQuestionsAsync(projectId));
    }
コード例 #3
0
        public void LogsErrorWhenInputIsZero()
        {
            var mockLogger       = new Mock <ILoggerAdapter <SomeOtherService> >();
            var someOtherService = new SomeOtherService(mockLogger.Object);

            someOtherService.DoSomething(0);

            mockLogger.Verify(l => l.LogError(It.IsAny <Exception>(), It.IsAny <string>(), 0));
        }
コード例 #4
0
 public HomeController(
     SomeOtherService baseService,
     ISingletonService singletonService,
     ITransientService transientService,
     IScopedService scopedService)
 {
     _singletonService = singletonService;
     _transientService = transientService;
     _scopedService    = scopedService;
     _baseService      = baseService;
 }
コード例 #5
0
 public AService(SomeOtherService otherService)
 {
     this.OtherService = otherService;
 }
コード例 #6
0
 public AService(SomeOtherService otherService)
 {
     this.OtherService = otherService;
 }