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); }
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); }
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); }