public void after_Add_getChangeSet_contains_change()
        {
            IChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( svc, false ) );
            p.Add( new Person( svc, false ) );

            IChangeSet cSet = svc.GetChangeSet();

            cSet.Count.Should().Be.EqualTo( 2 );
        }
        public void afterPropertyChanges_getChangeSet_contains_change()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, false );
            p.Name = "Mauro";
            p.Name = "Andrea";

            IChangeSet cSet = svc.GetChangeSet();

            Assert.AreEqual<Int32>( 2, cSet.Count );
        }
        public void service_after_add_getChangeSet_return_valid_cSet()
        {
            RejectCallback<String> cb = cv => { };
            Object fakeOwner = new Object();
            String change = String.Empty;
            IChange expected = new PropertyValueChange<String>( fakeOwner, "property-name", change, cb );

            ChangeTrackingService svc = new ChangeTrackingService();
            svc.Add( expected, AddChangeBehavior.RedoRequest );

            IChangeSet cSet = svc.GetChangeSet();

            Assert.AreEqual<IChange>( expected, cSet.First() );
        }
        public void service_getChangeSet_returns_valid_cSet()
        {
            Int32 expected = 2;
            Int32 actual = 0;

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, true );
            p.Name = "Mauro";
            p.Name = "Mauro";
            p.Name = "Foo";

            IChangeSet cSet = svc.GetChangeSet();
            actual = cSet.Count;

            Assert.AreEqual<Int32>( expected, actual );
        }
        public void service_getChangeSet_with_valid_iChangeSetFilter()
        {
            Int32 expected = 2;
            Int32 actual = 0;

            IChangeSetFilter mock = MockRepository.GenerateMock<IChangeSetFilter>();
            mock.Expect( f => f.ShouldInclude( null ) )
                .IgnoreArguments()
                .Repeat.Times( 2 )
                .Return( true );

            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc, true );
            p.Name = "Mauro";
            p.Name = "Mauro";
            p.Name = "Foo";

            IChangeSet cSet = svc.GetChangeSet( mock );
            actual = cSet.Count;

            mock.VerifyAllExpectations();
            Assert.AreEqual<Int32>( expected, actual );
        }
 public void service_getChangeSet_with_null_iChangeSetFilter()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     svc.GetChangeSet( null );
 }
 public void service_getChangeSet_with_null_iChangeSetFilter_argumentNullExeption()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     svc.GetChangeSet( null );
 }
        public void service_getChangeSet_when_is_not_changed_empty_cSet()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            IChangeSet cSet = svc.GetChangeSet();

            Assert.IsNotNull( cSet );
            Assert.AreEqual<Int32>( 0, cSet.Count );
        }
        public void service_getChangeSet_returns_valid_cSet()
        {
            Int32 expected = 3;
            Int32 actual = 0;

            ChangeTrackingService svc = new ChangeTrackingService();

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( null, false ) );
            p.Add( new Person( null, false ) );
            p.Move( 0, 1 );

            IChangeSet cSet = svc.GetChangeSet();
            actual = cSet.Count;

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