本文整理汇总了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();
}
示例2: service_getAdvisory_with_null_iAdvisoryBuilder_argumentNull_Exception
public void service_getAdvisory_with_null_iAdvisoryBuilder_argumentNull_Exception()
{
ChangeTrackingService svc = new ChangeTrackingService();
svc.GetAdvisory( null );
}
示例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 );
}
示例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() );
}
示例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 );
}
示例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 );
}
示例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 );
}
}
示例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 );
}
示例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 );
}