public void TestJObjectAccess()
        {
            var foo = new List <Choice>()
            {
                new Choice()
                {
                    Value = "test1"
                },
                new Choice()
                {
                    Value = "test2"
                },
                new Choice()
                {
                    Value = "test3"
                }
            };

            var ep     = new Adaptive.ChoiceSet(JArray.FromObject(foo));
            var result = ep.GetValue(new object());

            Assert.AreEqual("test1", result[0].Value);
            Assert.AreEqual("test2", result[1].Value);
            Assert.AreEqual("test3", result[2].Value);
        }
        public void TestExpressionAccess()
        {
            var state = new
            {
                choices = new List <Choice>()
                {
                    new Choice()
                    {
                        Value = "test1"
                    },
                    new Choice()
                    {
                        Value = "test2"
                    },
                    new Choice()
                    {
                        Value = "test3"
                    }
                }
            };

            var ep     = new Adaptive.ChoiceSet("choices");
            var result = ep.GetValue(state);

            Assert.AreEqual("test1", result[0].Value);
            Assert.AreEqual("test2", result[1].Value);
            Assert.AreEqual("test3", result[2].Value);
        }
        public void TestStringArrayAccess()
        {
            var foo = new List <string>()
            {
                "test1", "test2", "test3"
            };
            var ep     = new Adaptive.ChoiceSet(JArray.FromObject(foo));
            var result = ep.GetValue(new object());

            Assert.AreEqual("test1", result[0].Value);
            Assert.AreEqual("test2", result[1].Value);
            Assert.AreEqual("test3", result[2].Value);
        }
        public void TestValueAccess()
        {
            var state = new object();
            var ep    = new Adaptive.ChoiceSet(new List <Choice>()
            {
                new Choice()
                {
                    Value = "test1"
                },
                new Choice()
                {
                    Value = "test2"
                },
                new Choice()
                {
                    Value = "test3"
                }
            });
            var result = ep.GetValue(state);

            Assert.AreEqual("test1", result[0].Value);
            Assert.AreEqual("test2", result[1].Value);
            Assert.AreEqual("test3", result[2].Value);
        }