コード例 #1
0
        public void DefaultValueExpression()
        {
            IParserContext context = new FlexContext();

            context.Set("a", "");
            context.Set("b", "z");


            Assert.AreEqual("x", _parser.Evaluate <string>("a ?: \"x\"", context));
            Assert.AreEqual("z", _parser.Evaluate <string>("b ?: \"x\"", context));
        }
コード例 #2
0
        public void TestEscapes_Xml()
        {
            IParserContext vars = new FlexContext();

            string input = "$X";

            vars.Set("X", "A>B");

            string s = xmlParser.Render(input, vars);

            Assert.AreEqual("A&gt;B", s);
        }
コード例 #3
0
        public void TestDSDFSDFSDF()
        {
            IParserContext vars = new FlexContext();

            List <string> items = new List <string>();

            items.Add("A");
            items.Add("B");

            vars.Set("Items", items);

            string input = @"#foreach (item in Items)${item}#end#foreach (item in Items)${item}#end";

            string s = velocityParser.Render(input, vars);

            Assert.AreEqual("ABAB", s);
        }
コード例 #4
0
 public CreateTrainingPlan(IUserContext userContext, FlexContext dbContext)
 {
     this.dbContext   = dbContext;
     this.userContext = userContext;
 }
コード例 #5
0
 public StartTrainingPlan(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #6
0
 public GetTrainingPlanExercises(IUserContext userContext, FlexContext dbContext)
 {
     this.dbContext   = dbContext;
     this.userContext = userContext;
 }
コード例 #7
0
 public GetExercises(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #8
0
 public CreateExercise(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #9
0
 public DeleteTrainingPlan(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #10
0
 public RemoveExerciseFromTrainingPlan(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #11
0
 public CreateUser(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #12
0
 public UserContext(IHttpContextAccessor httpContextAccessor, FlexContext context, IMediator mediator)
 {
     this.httpContextAccessor = httpContextAccessor;
     this.context             = context;
     this.mediator            = mediator;
 }
コード例 #13
0
 public DeleteExercise(FlexContext dbContext)
 {
     this.dbContext = dbContext;
 }
コード例 #14
0
 public AddExerciseToTrainingPlan(IUserContext userContext, FlexContext dbContext)
 {
     this.dbContext   = dbContext;
     this.userContext = userContext;
 }