public void TestArrayPaths()
        {
            IList <TestNameClass> test = GetTestNameList();

            using (FluentFormContext.SpecifyArray("test", new object()))
            {
                Assert.AreEqual("test[0]", FluentFormContext.Path);
                Assert.AreEqual("test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => m.Name));
                Assert.AreEqual("test[0].test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => test[0].Name));
            }
        }
        public void TestArrayNoReuseSameKeys()
        {
            const int iterations = 10;

            IList <TestNameClass> test = GetTestNameList();

            for (int i = 0; i < iterations; i++)
            {
                using (FormContextInstance context = FluentFormContext.SpecifyArray("test", test))
                {
                    Assert.AreEqual(context.Path, FluentFormContext.Path);

                    Assert.AreEqual("test[0]", FluentFormContext.Path);
                    Assert.AreEqual("test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => m.Name));
                    Assert.AreEqual("test[0].test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => test[0].Name));
                }
            }
        }
        public void TestArrayReuse()
        {
            const int iterations = 10;

            IList <TestNameClass> test = GetTestNameList();

            for (int i = 0; i < iterations; i++)
            {
                // True must be used here to ensure "test" is overwritten
                using (FormContextInstance context = FluentFormContext.SpecifyArray("test", test, true))
                {
                    Assert.AreEqual(context.Path, FluentFormContext.Path);

                    Assert.AreEqual("test[0]", FluentFormContext.Path);
                    Assert.AreEqual("test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => m.Name));
                    Assert.AreEqual("test[0].test[0].Name", FluentFormContext.PathFor <TestNameClass, string>(m => test[0].Name));
                }
            }
        }