示例#1
0
 public void Setup()
 {
     _resolver         = MockRepository.GenerateStub <IParserResolver>();
     _targetRepository = MockRepository.GenerateStub <ITargetRepository>();
     _subject          = new TargetParser(_resolver, _targetRepository);
     _resolver.Stub(x => x.Resolve("call")).Return(new UnkownTypeParser());
     _targetXml = XElement.Parse("<target name=\"basic\" depends=\"clean, compile\"><call target=\"mainbuild\"/></target>");
 }
示例#2
0
 public void Setup()
 {
     _resolver = MockRepository.GenerateStub<IParserResolver>();
     _targetRepository = MockRepository.GenerateStub<ITargetRepository>();
     _subject = new TargetParser(_resolver, _targetRepository);
     _resolver.Stub(x => x.Resolve("call")).Return(new UnkownTypeParser());
     _targetXml = XElement.Parse("<target name=\"basic\" depends=\"clean, compile\"><call target=\"mainbuild\"/></target>");
 }
        public ConsultationRepository(RepositoryConfiguration config, IParserResolver parserResolver)
        {
            using var credStream = new FileStream(config.CredentialsFile, FileMode.Open, FileAccess.Read);
            var creds = GoogleWebAuthorizationBroker.AuthorizeAsync(
                clientSecrets: GoogleClientSecrets.Load(credStream).Secrets,
                scopes: new[] { SheetsService.Scope.SpreadsheetsReadonly },
                user: "******",
                taskCancellationToken: CancellationToken.None,
                dataStore: new FileDataStore(config.TokensTempFile, true)
                ).Result;

            this.sheets = new SheetsService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = creds,
                ApplicationName       = nameof(NureSEConsultations)
            });

            this.config         = config;
            this.parserResolver = parserResolver;
        }
示例#4
0
 public TargetParser(IParserResolver resolver, ITargetRepository targetRepository)
 {
     _resolver = resolver;
     _targetRepository = targetRepository;
 }
示例#5
0
 public TargetParser(IParserResolver resolver, ITargetRepository targetRepository)
 {
     _resolver         = resolver;
     _targetRepository = targetRepository;
 }