當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。