Esempio 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);
 }
Esempio 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);
 }
Esempio 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;
        }
Esempio 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);
 }
Esempio 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);
        }
Esempio 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);
 }
Esempio 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));
        }
Esempio 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);
        }
Esempio n. 10
0
 override public void LeaveGivenStatement(GivenStatement node)
 {
     NotImplemented(node, "given");
 }
Esempio n. 11
0
 public override void Accept(GivenStatement switchStmt)
 {
     errorLog.AddError(ErrorType.ParserError, switchStmt.Location,
                       "statement can not exist inside pattern!");
 }
 public override void Accept(GivenStatement givenStmt)
 {
     givenStmt.VisitChildren(this);
 }
Esempio n. 13
0
 public override void Accept(GivenStatement switchStmt)
 {
     errorLog.AddError(ErrorType.ParserError, switchStmt.Location,
                       "Statement not allowed outside function body!");
 }
Esempio n. 14
0
 public virtual void Accept(GivenStatement switchStmt)
 {
 }