当前位置: 首页>>代码示例>>C#>>正文


C# ChangeTrackingService.GetAdvisory方法代码示例

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


在下文中一共展示了ChangeTrackingService.GetAdvisory方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: service_generate_valid_adivsory_with_valid_iAdvisoryBuilder

        public void service_generate_valid_adivsory_with_valid_iAdvisoryBuilder()
        {
            IAdvisoryBuilder mock = MockRepository.GenerateMock<IAdvisoryBuilder>();
            mock.Expect( b => b.GenerateAdvisory( null, null ) )
                .IgnoreArguments()
                .Repeat.Once()
                .Return( new Advisory( new IAdvisedAction[ 0 ] ) );

            ChangeTrackingService svc = new ChangeTrackingService();

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

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

            mock.VerifyAllExpectations();
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:17,代码来源:EntityChangeTrackingServiceTests.cs

示例2: service_getAdvisory_with_null_iAdvisoryBuilder_argumentNull_Exception

 public void service_getAdvisory_with_null_iAdvisoryBuilder_argumentNull_Exception()
 {
     ChangeTrackingService svc = new ChangeTrackingService();
     svc.GetAdvisory( null );
 }
开发者ID:RadicalFx,项目名称:Radical,代码行数:5,代码来源:EntityChangeTrackingServiceTests.cs

示例3: service_should_generate_advisory_with_update_action

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

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

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

            Assert.AreEqual<ProposedActions>( ProposedActions.Update, advisory.First().Action );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:11,代码来源:EntityChangeTrackingServiceTests.cs

示例4: service_with_no_changes_generate_empty_advisory

        public void service_with_no_changes_generate_empty_advisory()
        {
            ChangeTrackingService svc = new ChangeTrackingService();
            IEnumerable<IAdvisedAction> advisory = svc.GetAdvisory();

            Assert.IsNotNull( advisory );
            Assert.AreEqual<Int32>( 0, advisory.Count() );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:8,代码来源:EntityChangeTrackingServiceTests.cs

示例5: service_generate_valid_advisory

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

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

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

            Assert.IsNotNull( advisory );
            Assert.AreEqual<Int32>( 1, advisory.Count() );
            Assert.AreEqual<ProposedActions>( ProposedActions.Create, advisory.First().Action );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:EntityChangeTrackingServiceTests.cs

示例6: service_getAdvisory_generate_valid_advisory_with_more_changes_applied_to_the_same_entity

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

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

示例8: service_on_single_add_generate_valid_advisory_even_with_transient_persistable_entity

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

            PersonCollection p = new PersonCollection( svc );
            p.Add( new Person( null, ChangeTrackingRegistration.AsTransient, TransientRegistration.AsPersistable ) );

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

            Assert.IsNotNull( advisory );
            Assert.AreEqual<Int32>( 1, advisory.Count() );
            Assert.AreEqual<ProposedActions>( ProposedActions.Create, advisory.First().Action );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:CollectionChangeTrackingServiceTests.cs

示例9: service_on_single_add_generate_valid_advisory

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

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

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

            Assert.IsNotNull( advisory );
            Assert.AreEqual<Int32>( 1, advisory.Count() );
            Assert.AreEqual<ProposedActions>( ProposedActions.Update, advisory.First().Action );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:13,代码来源:CollectionChangeTrackingServiceTests.cs


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