Пример #1
0
        public void Setup()
        {
            var refAnon  = new SSTReferenceAnonymization();
            var exprAnon = new SSTExpressionAnonymization(refAnon);
            var stmtAnon = new SSTStatementAnonymization(exprAnon, refAnon);

            _sut = new SSTAnonymization(stmtAnon);
        }
        public void BaseSetup()
        {
            AnyVarReference = new VariableReference {
                Identifier = "i"
            };
            AnyVarReferenceAnonymized = new VariableReference {
                Identifier = "i".ToHash()
            };
            AnyVarDeclaration = new VariableDeclaration {
                Reference = AnyVarReference
            };
            AnyVarDeclarationAnonymized = new VariableDeclaration {
                Reference = AnyVarReferenceAnonymized
            };
            AnyExpression = new ReferenceExpression {
                Reference = AnyVarReference
            };
            AnyExpressionAnonymized = new ReferenceExpression {
                Reference = AnyVarReferenceAnonymized
            };
            AnyStatement = new ThrowStatement {
                Reference = AnyVarReference
            };
            AnyStatementAnonymized = new ThrowStatement {
                Reference = AnyVarReferenceAnonymized
            };

            AnyLoopHeaderBlock = new LoopHeaderBlockExpression
            {
                Body = { AnyStatement }
            };
            AnyLoopHeaderBlockAnonymized = new LoopHeaderBlockExpression
            {
                Body = { AnyStatementAnonymized }
            };

            AnyLambdaExpr = new LambdaExpression
            {
                Name = Names.Lambda("[V,P] ([T,P] a)"),
                Body = { AnyStatement }
            };
            AnyLambdaExprAnonymized = new LambdaExpression
            {
                Name = AnyLambdaExpr.Name.ToAnonymousName(),
                Body = { AnyStatementAnonymized }
            };

            ReferenceAnonymizationMock  = new SSTReferenceAnonymization();
            ExpressionAnonymizationMock = new SSTExpressionAnonymization(ReferenceAnonymizationMock);
            StatementAnonymizationMock  = new SSTStatementAnonymization(
                ExpressionAnonymizationMock,
                ReferenceAnonymizationMock);
        }
 public void Setup()
 {
     _sut = new SSTStatementAnonymization(ExpressionAnonymizationMock, ReferenceAnonymizationMock);
 }