Esempio n. 1
0
 public void TestObjectContextPath()
 {
     Assert.AreEqual(string.Empty, FluentFormContext.Path);
     FluentFormContext.SpecifyObject("Test");
     Assert.AreEqual("Test", FluentFormContext.Path);
     FluentFormContext.Clear();
     Assert.AreEqual(string.Empty, FluentFormContext.Path);
 }
Esempio n. 2
0
        public void TestNestedContextPath()
        {
            using (FormContextInstance context = FluentFormContext.SpecifyArray("test", new object()))
            {
                Assert.AreEqual(context.Path, FluentFormContext.Path);

                using (FormContextInstance objectContext = FluentFormContext.SpecifyObject("object"))
                {
                    // TODO: context.Path to be relative to when it was created not the current path
                    Assert.AreEqual(objectContext.Path, FluentFormContext.Path);
                }

                Assert.AreEqual(context.Path, FluentFormContext.Path);
            }

            Assert.AreEqual(string.Empty, FluentFormContext.Path);
        }