mirror of https://github.com/abpframework/abp
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							37 lines
						
					
					
						
							775 B
						
					
					
				
			
		
		
	
	
							37 lines
						
					
					
						
							775 B
						
					
					
				| using System.Linq;
 | |
| using Shouldly;
 | |
| using Xunit;
 | |
| 
 | |
| namespace Volo.Abp.EventBus
 | |
| {
 | |
|     public class GenericEventNameAttribute_Tests
 | |
|     {
 | |
|         [Fact]
 | |
|         public void Should_Properly_Get_EventName()
 | |
|         {
 | |
|             var eventType = typeof(MyGenericType<MyInnerType>);
 | |
| 
 | |
|             var eventNameProvider = eventType
 | |
|                 .GetCustomAttributes(true)
 | |
|                 .OfType<IEventNameProvider>()
 | |
|                 .Single();
 | |
| 
 | |
|             eventNameProvider
 | |
|                 .GetName(eventType)
 | |
|                 .ShouldBe("MyEvent.GenericTest");
 | |
|         }
 | |
| 
 | |
|         [EventName("MyEvent")]
 | |
|         public class MyInnerType
 | |
|         {
 | |
| 
 | |
|         }
 | |
| 
 | |
|         [GenericEventName(Postfix = ".GenericTest")]
 | |
|         public class MyGenericType<T>
 | |
|         {
 | |
| 
 | |
|         }
 | |
|     }
 | |
| }
 |