Exemplo n.º 1
0
 public static GivenStatement NewApiKey(this GivenStatement givenStatement,
                                        TestUserApiKeyJsonEntity apiKey, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving api keys {apiKey}", givenStatement.GetType().Name);
     givenStatement.AddData(apiKey, BddKeyConstants.NewApiKey + testKey);
     return(givenStatement);
 }
Exemplo n.º 2
0
 public static GivenStatement ApiKeyToRemove(this GivenStatement givenStatement,
                                             string apiKey, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving api key description to remove {apiKey}", givenStatement.GetType().Name);
     givenStatement.AddData(apiKey, BddKeyConstants.ApiKeyToRemove + testKey);
     return(givenStatement);
 }
Exemplo n.º 3
0
        public override void Switch(IAstTransformer transformer, out Node resultingNode)
        {
            GivenStatement thisNode           = (GivenStatement)this;
            Statement      resultingTypedNode = thisNode;

            transformer.OnGivenStatement(thisNode, ref resultingTypedNode);
            resultingNode = resultingTypedNode;
        }
Exemplo n.º 4
0
 public static GivenStatement NewUserData(this GivenStatement givenStatement,
                                          TestUserModel userModel, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving user model {userModel}", givenStatement.GetType().Name);
     givenStatement.AddData(userModel, testKey);
     return(givenStatement);
 }
 public static GivenStatement NewTimeSeries(this GivenStatement givenStatement,
                                            TestTimeSeriesMetadataModel timeSeries, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving time-series to create {timeSeries}",
                  givenStatement.GetType().Name);
     givenStatement.AddData(timeSeries, BddKeyConstants.TimeSeriesToCreate + testKey);
     return(givenStatement);
 }
Exemplo n.º 6
0
        public static GivenStatement UserSession(this GivenStatement givenStatement, string session,
                                                 string testKey = null)
        {
            givenStatement.GetStatementLogger()
            .Information($"[{{ContextStatement}}] Saving user session '{session}'", givenStatement.GetType().Name);

            givenStatement.AddData(session, BddKeyConstants.SessionTokenKey + testKey);
            return(givenStatement);
        }
Exemplo n.º 7
0
 public static GivenStatement UserLoginCredentials(this GivenStatement givenStatement,
                                                   TestLoginModel loginCredentials, string testKey = null)
 {
     givenStatement.GetStatementLogger()
     .Information($"[{{ContextStatement}}] Saving user credentials {loginCredentials}",
                  givenStatement.GetType().Name);
     givenStatement.AddData(loginCredentials, testKey);
     return(givenStatement);
 }
Exemplo n.º 8
0
        public static GivenStatement DefaultUserLoginCredentials(this GivenStatement givenStatement,
                                                                 string testKey = null)
        {
            var loginCredentials = new TestLoginModel
            {
                Email    = _configuration.UserName,
                Password = _configuration.Password,
            };

            return(givenStatement.UserLoginCredentials(loginCredentials, testKey));
        }
Exemplo n.º 9
0
        public override void Accept(GivenStatement switchStmt)
        {
            foreach (AstNode node in switchStmt.WhenStatements.Children)
            {
                WhenStatement caseStmt = node as WhenStatement;
                caseStmt.Values.Visit(this);
                caseStmt.Body.Visit(this);
            }
            switchStmt.GivenValue.Visit(this);
            methodBuilder.EmitInstruction(switchStmt.Location, Opcode.SwitchLookup, switchStmt.WhenStatements.Children.Count);
            IodineLabel endLabel = methodBuilder.CreateLabel();

            methodBuilder.EmitInstruction(switchStmt.Location, Opcode.JumpIfTrue, endLabel);
            switchStmt.DefaultStatement.Visit(this);
            methodBuilder.MarkLabelPosition(endLabel);
        }
Exemplo n.º 10
0
 override public void LeaveGivenStatement(GivenStatement node)
 {
     NotImplemented(node, "given");
 }
Exemplo n.º 11
0
 public override void Accept(GivenStatement switchStmt)
 {
     errorLog.AddError(ErrorType.ParserError, switchStmt.Location,
                       "statement can not exist inside pattern!");
 }
Exemplo n.º 12
0
 public override void Accept(GivenStatement givenStmt)
 {
     givenStmt.VisitChildren(this);
 }
Exemplo n.º 13
0
 public override void Accept(GivenStatement switchStmt)
 {
     errorLog.AddError(ErrorType.ParserError, switchStmt.Location,
                       "Statement not allowed outside function body!");
 }
Exemplo n.º 14
0
 public virtual void Accept(GivenStatement switchStmt)
 {
 }