public GreetingsUnitTests() { if (greetingsRepository == null) { greetingsRepository = new GreetingRepository(); } }
public GreeterService(ActivitySource activitySource, IProtoCache cache, IGreetingRepository repository, ILogger <GreeterService> logger) { _activitySource = activitySource; _cache = cache; _repository = repository; _logger = logger; }
public GreetingsControllerTests() { _repository = Mock.Of<IGreetingRepository>(); _controller = new GreetingsController(_repository, DtoMapperConfiguration.Build().CreateMapper()) { Request = new HttpRequestMessage {RequestUri = new Uri(ApiUrl)}, Configuration = new HttpConfiguration() }; }
public GreetingsControllerTests() { _repository = Mock.Of <IGreetingRepository>(); _controller = new GreetingsController(_repository, DtoMapperConfiguration.Build().CreateMapper()) { Request = new HttpRequestMessage { RequestUri = new Uri(ApiUrl) }, Configuration = new HttpConfiguration() }; }
/// <summary> /// This is dependency injection. We specify interfaces to be injected into the constructor. /// Because we registered Unity with Web API as a dependency resolver, it knows to ask Unity for dependencies when creating controller instances. /// </summary> public GreetingsController(IGreetingRepository greetingRepository, [Dependency("dtoMapper")] IMapper mapper) { _mapper = mapper; _greetingRepository = greetingRepository; }
public GreetingService(IGreetingRepository greetingRepository) { _greetingRepository = greetingRepository; }
public GreetingManager(IGreetingRepository repository) { _repository = repository; }
public void Setup() { greetingRepository = new GreetingRepository(); }
public HomeController(IGreetingRepository greetingRepository) { _greetingRepository = greetingRepository; }
/// <summary> /// This is dependency injection. We specify interfaces to be injected into the constructor. /// Because we registered Unity with Web API as a dependency resolver, it knows to ask Unity for dependencies when creating controller instances. /// </summary> public GreetingsController(IGreetingRepository greetingRepository, [Dependency("dtoMapper")] IMapper mapper) { _mapper = mapper; _greetingRepository = greetingRepository; }
public GreetingAppService(IGreetingRepository greetingRepository) { this.greetingRepository = greetingRepository; }