private void AssumeStatementFactoryProviderIsInitialised() { this.statementFactoryProvider = Substitute.For <IStatementFactoryProvider>(); this.statementFactory = Substitute.For <IStatementFactory>(); this.statementFactoryProvider.Provide() .Returns(this.statementFactory); }
public DefaultRouteBuilder( IStatementFactory statementFactory, IRouteGraphBuilder graphBuilder) { _statementFactory = statementFactory ?? throw new ArgumentNullException(nameof(statementFactory)); _graphBuilder = graphBuilder ?? throw new ArgumentNullException(nameof(graphBuilder)); }
public AccountService(IAccountFactory accountFactory, IAmountFactory amountFactory, IStatementCollectionFactory statementCollectionFactory, IStatementFactory statementFactory) { _accountFactory = accountFactory ?? throw new ArgumentNullException(nameof(accountFactory)); _amountFactory = amountFactory ?? throw new ArgumentNullException(nameof(amountFactory)); _statementCollectionFactory = statementCollectionFactory ?? throw new ArgumentNullException(nameof(statementCollectionFactory)); _statementFactory = statementFactory ?? throw new ArgumentNullException(nameof(statementFactory)); }
public void ParserShouldCallStatementFactoryAndContextManagerWhenParsingTokens() { IList <TokenBase> input = new List <TokenBase>(); input.Add(TokenCreator.Create <GenericToken>("source", null)); input.Add(TokenCreator.Create <GenericToken>("code", null)); IStatementFactory factory = Mocker.StrictMock <IStatementFactory>(); IStatementContext context = Mocker.StrictMock <IStatementContext>(); IStatementContextManager contextManager = Mocker.StrictMock <IStatementContextManager>(); Expect.Call(factory.CanCreateStatementFrom(new List <TokenBase>(), context)).IgnoreArguments().Return(true).Repeat.Once(); Expect.Call(factory.Create(input, context)).Return(new GenericStatement(input, context)).Repeat.Once(); Expect.Call(() => contextManager.Encountered(new[] { new GenericStatement(input, context) }, input.Count, input)).Repeat.Once(); Expect.Call(contextManager.GetContext(input)).Return(context).Repeat.Once(); input.Add(TokenCreator.Create <SemiColonToken>()); StubStatementFactoryProvider provider = new StubStatementFactoryProvider(factory); CalidusStatementParser parser = new CalidusStatementParser(provider, contextManager); Mocker.ReplayAll(); parser.Parse(input); Mocker.VerifyAll(); }
public TypescriptNamespace( IStatementFactory statementFactory, IMemberFactory memberFactory) { _statementFactory = statementFactory; _memberFactory = memberFactory; System.Diagnostics.Debug.WriteLine("Typescriptnamespace Created"); }
public StatementService( IStatementFactory statementFactory, IStatementRepository statementRepository, IUnitOfWork unitOfWork) { this.statementRepository = statementRepository; this.statementFactory = statementFactory; this.unitOfWork = unitOfWork; }
public DefaultRouteBuilderTest() { _fixture = new Fixture(); _statementFactory = Substitute.For <IStatementFactory>(); _graphBuilder = Substitute.For <IRouteGraphBuilder>(); _builder = new DefaultRouteBuilder(_statementFactory, _graphBuilder); }
public TypescriptConstructor( IExpressionFactory expressionFactory, IStatementFactory statementFactory, CodeConstructor member, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statementFactory = statementFactory; _member = member; _options = options; }
public TypescriptRemoveEventStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeRemoveEventStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public TypescriptMethodReturnStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeMethodReturnStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public TypescriptGotoStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeGotoStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; }
public TypescriptVariableDeclarationStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeVariableDeclarationStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; _typescriptTypeMapper = new TypescriptTypeMapper(); }
public TypescriptTryCatchFinallyStatement( IStatementFactory statementFactory, IExpressionFactory expressionFactory, CodeTryCatchFinallyStatement statement, CodeGeneratorOptions options) { _statementFactory = statementFactory; _expressionFactory = expressionFactory; _statement = statement; _options = options; _typescriptTypeMapper = new TypescriptTypeMapper(); }
public TypescriptMemberProperty( CodeMemberProperty member, IStatementFactory statementFactory, IExpressionFactory expressionFactory, ITypescriptTypeMapper typescriptTypeMapper, CodeGeneratorOptions options) { _member = member; _statementFactory = statementFactory; _expressionFactory = expressionFactory; _typescriptTypeMapper = typescriptTypeMapper; _options = options; }
public static string GetStatementsFromCollection(this CodeStatementCollection statementCollection, IStatementFactory statementFactory, CodeGeneratorOptions options) { if (statementCollection.Count <= 0) return string.Empty; return statementCollection .OfType<CodeStatement>() .Select(statement => { var statementLines = statementFactory.GetStatement(statement, options); return statementLines.Expand(); }) .Aggregate((previous, current) => $"{previous}{Environment.NewLine}{current}"); }
public TypescriptMemberMethod( IExpressionFactory expressionFactory, IStatementFactory statementFactory, ITypescriptTypeMapper typescriptTypeMapper, ITypescriptTypeParameter typescriptTypeParameter, CodeMemberMethod member, CodeGeneratorOptions options) { _expressionFactory = expressionFactory; _statementFactory = statementFactory; _typescriptTypeMapper = typescriptTypeMapper; _typescriptTypeParameter = typescriptTypeParameter; _member = member; _options = options; }
public IStatementStatus ChangeStatus( IStatementFactory statementFactory, StatusCode statusCode, StatusComment statusComment) { var statementStatus = statementFactory.NewStatus( this, statusCode, statusComment); this.CurrentStatus = statementStatus; this.StatusHistory.Add(statementStatus); return(statementStatus); }
public MemberFactory( IExpressionFactory expressionFactory, IStatementFactory statementFactory, ITypescriptTypeMapper typescriptTypeMapper, ITypescriptTypeParameter typescriptTypeParameter) { _expressionFactory = expressionFactory; _statementFactory = statementFactory; _typescriptTypeMapper = typescriptTypeMapper; _typescriptTypeParameter = typescriptTypeParameter; _memberMap = new Dictionary <Type, Func <CodeTypeMember, CodeGeneratorOptions, IMember> >(); ConstructMembers(); System.Diagnostics.Debug.WriteLine("MemberFactory Created"); }
public TypescriptCodeGenerator( IMemberFactory memberFactory, IStatementFactory statementFactory, IExpressionFactory expressionFactory, ITypescriptNamespace typescriptNamespace, ITypescriptTypeMapper typescriptTypeMapper, ITypescriptKeywordsHandler typescriptKeywordsHandler) { _memberFactory = memberFactory; _typescriptKeywordsHandler = typescriptKeywordsHandler; _typescriptTypeMapper = typescriptTypeMapper; _expressionFactory = expressionFactory; _typescriptNamespace = typescriptNamespace; _statementFactory = statementFactory; System.Diagnostics.Debug.WriteLine("TypescriptCodeGenerator Created"); }
public TransactionEtl( ILogger <TransactionEtl> logger, IBankStatementWebScraper bankStatementWebScraper, IStatementFactory statementFactory, ITransactionImportJobRepository transactionImportJobs, IAccountsRepository accounts, ITransactionsRepository transactions, IUnitOfWork unitOfWork, IOptions <TransactionEtlOptions> options) { _logger = logger; _bankStatementWebScraper = bankStatementWebScraper; _statementFactory = statementFactory; _transactionImportJobs = transactionImportJobs; _accounts = accounts; _transactions = transactions; _unitOfWork = unitOfWork; _options = options.Value; _unprocessedPath = options.Value.UnprocessedStatementDirectory ?? throw new ArgumentNullException( nameof(options.Value.UnprocessedStatementDirectory), "Unprocessed statement directory is required"); if (!Directory.Exists(_unprocessedPath)) { Directory.CreateDirectory(_unprocessedPath); } _processedPath = options.Value.ProcessedStatementDirectory ?? throw new ArgumentNullException( nameof(options.Value.ProcessedStatementDirectory), "Processed statement directory is required"); if (!Directory.Exists(_processedPath)) { Directory.CreateDirectory(_processedPath); } _moveProcessedStatements = options.Value.MoveProcessedStatements; }
public static string GetStatementsFromCollection(this CodeStatementCollection statementCollection, IStatementFactory statementFactory, CodeGeneratorOptions options) { if (statementCollection.Count <= 0) { return(string.Empty); } return(statementCollection .OfType <CodeStatement>() .Select(statement => { var statementLines = statementFactory.GetStatement(statement, options); return statementLines.Expand(); }) .Aggregate((previous, current) => $"{previous}{Environment.NewLine}{current}")); }
public Repository(IStatementFactory statementFactory) : base(statementFactory) { }
public StubStatementFactoryProvider() { _factory = null; }
public Repository(IStatementFactory statementFactory) { this.statementFactory = statementFactory; }
public StubStatementFactoryProvider(IStatementFactory factory) { _factory = factory; }