• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ChangeTracking.ChangeTrackingService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Topics.Radical.ChangeTracking.ChangeTrackingService的典型用法代码示例。如果您正苦于以下问题:C# ChangeTrackingService类的具体用法?C# ChangeTrackingService怎么用?C# ChangeTrackingService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ChangeTrackingService类属于Topics.Radical.ChangeTracking命名空间,在下文中一共展示了ChangeTrackingService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: changeTrackingService_beginAtomicOperation_normal_should_create_valid_atomic_operation

		public void changeTrackingService_beginAtomicOperation_normal_should_create_valid_atomic_operation()
		{
			var target = new ChangeTrackingService();
			var actual = target.BeginAtomicOperation();

			actual.Should().Not.Be.Null();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:7,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例2: 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


示例3: changeTrackingService_hasTransientEntities_should_be_true_after_undo

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

            svc.HasTransientEntities.Should().Be.True();
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:8,代码来源:EntityChangeTrackingServiceTests.cs


示例4: entityMemento_ctor_memento_set_default_values

		public void entityMemento_ctor_memento_set_default_values()
		{
			var expected = new ChangeTrackingService();
			var target = this.CreateMock( expected );

			( ( IMemento )target ).Memento.Should().Be.EqualTo( expected );
			( ( IMemento )target ).Memento.Should().Be.EqualTo( expected );
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:8,代码来源:EntityMementoTests.cs


示例5: afterPropertyChange_canUndo_is_true

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

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

            Assert.IsTrue( svc.CanUndo );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:9,代码来源:EntityChangeTrackingServiceTests.cs


示例6: after_Add_canUndo_is_true

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

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

            svc.CanUndo.Should().Be.True();
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:9,代码来源:CollectionChangeTrackingServiceTests.cs


示例7: after_mutual_exclusive_actions_service_CanUndo

        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 );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:10,代码来源:CollectionChangeTrackingServiceTests.cs


示例8: after_Add_getChangeSet_contains_change

        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 );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:12,代码来源:CollectionChangeTrackingServiceTests.cs


示例9: after_Undo_collection_is_rolledback

        public void after_Undo_collection_is_rolledback()
        {
            Int32 expected = 0;

            IChangeTrackingService svc = new ChangeTrackingService();

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

            svc.Undo();

            p.Count.Should().Be.EqualTo( expected );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:CollectionChangeTrackingServiceTests.cs


示例10: after_add_GetEntityState_is_Changed

        public void after_add_GetEntityState_is_Changed()
        {
            EntityTrackingStates expected = EntityTrackingStates.HasBackwardChanges;

            ChangeTrackingService svc = new ChangeTrackingService();

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

            EntityTrackingStates actual = svc.GetEntityState( p );

            actual.Should().Be.EqualTo( expected );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:14,代码来源:CollectionChangeTrackingServiceTests.cs


示例11: 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


示例12: changeTrackingService_using_beginAtomicOperation_should_set_is_changed_only_on_operation_completed

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

			var person = new Person( target );
			var list = new PersonCollection( target );

			using( var actual = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				target.IsChanged.Should().Be.False();

				actual.Complete();
			}

			target.IsChanged.Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:20,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例13: changeTrackingService_using_beginAtomicOperation_should_fully_rollback_on_single_undo

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

			var person = new Person( target );
			var list = new PersonCollection( target );

			using( var actual = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				actual.Complete();
			}

			target.Undo();

			list.Count.Should().Be.EqualTo( 0 );
			person.Name.Should().Be.EqualTo( String.Empty );
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:21,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例14: ChangeTrackingService

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

			var list = new PersonCollection( target );
			var person = new Person( target, false );

			using( var op = target.BeginAtomicOperation() )
			{
				target.RegisterTransient( person );
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				op.Complete();
			}

			var actual = target.HasTransientEntities;

			actual.Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:21,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例15: changeTrackingService_using_beginAtomicOperation_getEntities_should_return_all_transient_entities

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

			var list = new PersonCollection( target );
			var person = new Person( target, false );

			using( var op = target.BeginAtomicOperation() )
			{
				target.RegisterTransient( person );
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				op.Complete();
			}

			var actual = target.GetEntities( EntityTrackingStates.IsTransient, false );

			actual.Contains( person ).Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:21,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例16: changeTrackingService_using_beginAtomicOperation_getEntities_should_return_all_changed_entities

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

			var person = new Person( target );
			var list = new PersonCollection( target );

			using( var op = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				op.Complete();
			}

			var actual = target.GetEntities( EntityTrackingStates.HasBackwardChanges, false );

			/*
			 * Non funziona perchè non funziona GetEntityState()
			 */

			actual.Contains( person ).Should().Be.True();
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:24,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例17: changeTrackingService_using_beginAtomicOperation_getEntityState_should_return_valid_entity_state

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

			var person = new Person( target );
			var list = new PersonCollection( target );

			using( var op = target.BeginAtomicOperation() )
			{
				person.Name = "Mauro";
				list.Add( person );
				person.Name = "Mauro Servienti";

				op.Complete();
			}

			var actual = target.GetEntityState( person );
			actual.Should().Be.EqualTo( EntityTrackingStates.HasBackwardChanges | EntityTrackingStates.IsTransient | EntityTrackingStates.AutoRemove );
		}
开发者ID:nazarenomanco,项目名称:Radical,代码行数:19,代码来源:AtomicChangesChangeTrackingServiceTests.cs


示例18: afterUndo_propertyValue_is_rolledback

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

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

            svc.Undo();

            Assert.AreEqual<String>( expected, p.Name );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:12,代码来源:EntityChangeTrackingServiceTests.cs


示例19: service_successfully_revert_to_a_valid_bookmark_created_at_initial_state

        public void service_successfully_revert_to_a_valid_bookmark_created_at_initial_state()
        {
            String expected = String.Empty;

            ChangeTrackingService svc = new ChangeTrackingService();
            IBookmark bmk = svc.CreateBookmark();

            Person p = new Person( svc );
            p.Name = "foo..";
            p.Name = "foo once again...";

            svc.Revert( bmk );

            Assert.AreEqual<String>( expected, p.Name );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:15,代码来源:EntityChangeTrackingServiceTests.cs


示例20: service_with_no_changes_create_non_null_bookmark

        public void service_with_no_changes_create_non_null_bookmark()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            var bmk = svc.CreateBookmark();

            Assert.IsNotNull( bmk );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:7,代码来源:EntityChangeTrackingServiceTests.cs



注:本文中的Topics.Radical.ChangeTracking.ChangeTrackingService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Models.touch_for_foodEntities类代码示例发布时间:2022-05-26
下一篇:
C# Tools.Serialiser类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap