Example #1
0
        public void UndoChildSuccess()
        {
            UnitTestContext context = GetContext();
            Person          p       = new Person();

            p.Addresses = new AddressList();
            Address a = new Address();

            p.Addresses.Add(a);

            int    age1  = p.Age = 1;
            string city1 = a.City = "one";

            p.BeginEdit();

            int    age2  = p.Age = 2;
            string city2 = a.City = "two";

            a.BeginEdit();

            string city3 = a.City = "three";

            a.CancelEdit();

            context.Assert.AreEqual(age2, p.Age);
            context.Assert.AreEqual(city2, a.City);
            p.CancelEdit();

            context.Assert.AreEqual(age1, p.Age);
            context.Assert.AreEqual(city1, a.City);
            context.Assert.Success();
            context.Complete();
        }
Example #2
0
        public void UndoChildFail()
        {
            UnitTestContext context = GetContext();
            Person          p       = new Person();

            p.Addresses = new AddressList();
            Address a = new Address();

            p.Addresses.Add(a);

            p.BeginEdit();
            p.CancelEdit();
            a.CancelEdit();
            context.Assert.Success();
            context.Complete();
        }
Example #3
0
    public void UndoChildSuccess()
    {
      UnitTestContext context = GetContext();
      Person p = new Person();
      p.Addresses = new AddressList();
      Address a = new Address();
      p.Addresses.Add(a);

      int age1 = p.Age = 1;
      string city1 = a.City = "one";
      p.BeginEdit();

      int age2 = p.Age = 2;
      string city2 = a.City = "two";
      a.BeginEdit();

      string city3 = a.City = "three";
      a.CancelEdit();

      context.Assert.AreEqual(age2, p.Age);
      context.Assert.AreEqual(city2, a.City);
      p.CancelEdit();

      context.Assert.AreEqual(age1, p.Age);
      context.Assert.AreEqual(city1, a.City);
      context.Assert.Success();
      context.Complete();
    }
Example #4
0
    public void UndoChildFail()
    {
      UnitTestContext context = GetContext();
      Person p = new Person();
      p.Addresses = new AddressList();
      Address a = new Address();
      p.Addresses.Add(a);

      p.BeginEdit();
      p.CancelEdit();
      a.CancelEdit();
      context.Assert.Success();
      context.Complete();
    }