Beispiel #1
0
        public void after_mutual_exclusive_actions_service_CanUndo()
        {
            IChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection(svc);

            p.Add(new Person(svc, false));
            p.RemoveAt(0);

            Assert.IsTrue(svc.CanUndo);
        }
Beispiel #2
0
        public void after_mutual_exclusive_actions_entity_state_is_HasBackwardChanges()
        {
            EntityTrackingStates expected = EntityTrackingStates.HasBackwardChanges;

            IChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection(svc);

            p.Add(new Person(svc, false));
            p.RemoveAt(0);

            EntityTrackingStates actual = svc.GetEntityState(p);

            Assert.AreEqual <EntityTrackingStates>(expected, actual);
        }
Beispiel #3
0
        public void service_getAdvisory_generate_valid_advisory_with_more_changes_applied_to_the_same_entity()
        {
            ProposedActions       expected = ProposedActions.Delete;
            ChangeTrackingService svc      = new ChangeTrackingService();

            PersonCollection list = new PersonCollection(svc);

            list.Add(new Person(null, false));    //First IChange
            list.RemoveAt(0);                     //Second IChange

            IAdvisory       advisory = svc.GetAdvisory();
            IAdvisedAction  action   = advisory.First();
            ProposedActions actual   = action.Action;

            Assert.AreEqual <ProposedActions>(expected, actual);
        }