當前位置: 首頁>>代碼示例>>C#>>正文


C# ChangeTrackingService.AcceptChanges方法代碼示例

本文整理匯總了C#中Topics.Radical.ChangeTracking.ChangeTrackingService.AcceptChanges方法的典型用法代碼示例。如果您正苦於以下問題:C# ChangeTrackingService.AcceptChanges方法的具體用法?C# ChangeTrackingService.AcceptChanges怎麽用?C# ChangeTrackingService.AcceptChanges使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Topics.Radical.ChangeTracking.ChangeTrackingService的用法示例。


在下文中一共展示了ChangeTrackingService.AcceptChanges方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: changeTrackingService_hasTransientEntities_should_be_false_after_acceptChanges

        public void changeTrackingService_hasTransientEntities_should_be_false_after_acceptChanges()
        {
            var svc = new ChangeTrackingService();
            var p = new Person( svc, true );
            svc.AcceptChanges();

            svc.HasTransientEntities.Should().Be.False();
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:8,代碼來源:EntityChangeTrackingServiceTests.cs

示例2: changeTrackingService_using_atomicOperation_after_operation_complete_entityState_should_be_changed

		public void changeTrackingService_using_atomicOperation_after_operation_complete_entityState_should_be_changed()
		{
			var target = new ChangeTrackingService();

			var person = new Person( target );

			target.AcceptChanges();
			
			using( var op = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";

				op.Complete();
			}

			var state = target.GetEntityState( person );

			var actual = (state & EntityTrackingStates.HasBackwardChanges ) == EntityTrackingStates.HasBackwardChanges;
			actual.Should().Be.True();
		}
開發者ID:nazarenomanco,項目名稱:Radical,代碼行數:20,代碼來源:AtomicChangesChangeTrackingServiceTests.cs

示例3: after_suspend_cannot_call_AcceptChanges

        public void after_suspend_cannot_call_AcceptChanges()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

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

            svc.Suspend();
            svc.AcceptChanges();
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:10,代碼來源:EntityChangeTrackingServiceTests.cs

示例4: after_acceptChanges_service_canRedo_is_false

        public void after_acceptChanges_service_canRedo_is_false()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

            Person p = new Person( svc );
            p.Name = "Mauro";
            svc.AcceptChanges();

            Assert.IsFalse( svc.CanRedo );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:10,代碼來源:EntityChangeTrackingServiceTests.cs

示例5: entity_registeredAsTransient_without_autoRemove_on_AcceptChanges_is_no_more_transient

        public void entity_registeredAsTransient_without_autoRemove_on_AcceptChanges_is_no_more_transient()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            EntityTrackingStates expected = EntityTrackingStates.None;

            Person p = new Person( svc, false );
            svc.RegisterTransient( p, false );
            svc.AcceptChanges();

            EntityTrackingStates actual = svc.GetEntityState( p );

            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:EntityChangeTrackingServiceTests.cs

示例6: after_acceptChanges_entity_is_no_more_changed

        public void after_acceptChanges_entity_is_no_more_changed()
        {
            EntityTrackingStates expected = EntityTrackingStates.None;

            ChangeTrackingService svc = new ChangeTrackingService();

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

            svc.AcceptChanges();

            EntityTrackingStates actual = svc.GetEntityState( p );
            Assert.AreEqual<EntityTrackingStates>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:14,代碼來源:EntityChangeTrackingServiceTests.cs

示例7: service_on_acceptChanges_successfully_commit_a_commitSupported_change

        public void service_on_acceptChanges_successfully_commit_a_commitSupported_change()
        {
            var iChange = MockRepository.GenerateStub<IChange>();
            iChange.Expect( obj => obj.IsCommitSupported ).Return( true );
            iChange.Expect( obj => obj.Commit( CommitReason.AcceptChanges ) ).Repeat.Once();

            var svc = new ChangeTrackingService();
            svc.Add( iChange, AddChangeBehavior.Default );

            svc.AcceptChanges();

            iChange.VerifyAllExpectations();
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:EntityChangeTrackingServiceTests.cs

示例8: service_on_acceptChanges_with_nothing_to_do_not_raise_trackingServiceStateChanged_event

        public void service_on_acceptChanges_with_nothing_to_do_not_raise_trackingServiceStateChanged_event()
        {
            Int32 expected = 0;
            Int32 actual = 0;

            ChangeTrackingService svc = new ChangeTrackingService();
            Person p = new Person( svc, false );

            svc.TrackingServiceStateChanged += ( sender, args ) => { actual++; };
            svc.AcceptChanges();

            Assert.AreEqual<Int32>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:13,代碼來源:EntityChangeTrackingServiceTests.cs

示例9: service_with_changes_and_transientEntities_on_acceptChanges_raise_trackingServiceStateChanged_event

        public void service_with_changes_and_transientEntities_on_acceptChanges_raise_trackingServiceStateChanged_event()
        {
            Int32 expected = 1;
            Int32 actual = 0;

            ChangeTrackingService svc = new ChangeTrackingService();
            Person p = new Person( svc );
            p.Name = "Mauro";

            svc.TrackingServiceStateChanged += ( sender, args ) => { actual++; };
            svc.AcceptChanges();

            Assert.AreEqual<Int32>( expected, actual );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:14,代碼來源:EntityChangeTrackingServiceTests.cs

示例10: service_on_clear_generate_valid_advisory

        public void service_on_clear_generate_valid_advisory()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

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

            svc.AcceptChanges();

            p.Clear();

            IEnumerable<IAdvisedAction> advisory = svc.GetAdvisory();

            Assert.IsNotNull( advisory );
            Assert.AreEqual<Int32>( 5, advisory.Count() );
            foreach( var aa in advisory )
            {
                Assert.AreEqual<ProposedActions>( ProposedActions.Delete, aa.Action );
            }
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:24,代碼來源:CollectionChangeTrackingServiceTests.cs

示例11: after_acceptChanges_service_canRedo_is_false

        public void after_acceptChanges_service_canRedo_is_false()
        {
            ChangeTrackingService svc = new ChangeTrackingService();

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

            svc.AcceptChanges();

            Assert.IsFalse( svc.CanRedo );
        }
開發者ID:RadicalFx,項目名稱:Radical,代碼行數:11,代碼來源:CollectionChangeTrackingServiceTests.cs


注:本文中的Topics.Radical.ChangeTracking.ChangeTrackingService.AcceptChanges方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。