File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
LinkDotNet.Blog.UnitTests Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Collections . Generic ;
23using FluentAssertions ;
34using LinkDotNet . Blog . Web . RegistrationExtensions ;
45using Microsoft . Extensions . DependencyInjection ;
@@ -8,15 +9,24 @@ namespace LinkDotNet.Blog.UnitTests
89{
910 public class StorageProviderRegistrationExtensionsTests
1011 {
11- [ Fact ]
12- public void GivenAlreadyRegisteredRepository_WhenTryingToAddAnotherOne_ThenException ( )
12+ public static IEnumerable < object [ ] > Data => new List < object [ ] >
13+ {
14+ new object [ ] { new Action < IServiceCollection > ( services => services . UseSqliteAsStorageProvider ( ) ) } ,
15+ new object [ ] { new Action < IServiceCollection > ( services => services . UseSqlAsStorageProvider ( ) ) } ,
16+ new object [ ] { new Action < IServiceCollection > ( services => services . UseInMemoryAsStorageProvider ( ) ) } ,
17+ new object [ ] { new Action < IServiceCollection > ( services => services . UseRavenDbAsStorageProvider ( ) ) } ,
18+ } ;
19+
20+ [ Theory ]
21+ [ MemberData ( nameof ( Data ) ) ]
22+ public void GivenAlreadyRegisteredRepository_WhenTryingToAddAnotherStorage_ThenException ( Action < IServiceCollection > act )
1323 {
1424 var services = new ServiceCollection ( ) ;
1525 services . UseRavenDbAsStorageProvider ( ) ;
1626
17- Action act = ( ) => services . UseSqliteAsStorageProvider ( ) ;
27+ Action actualAct = ( ) => act ( services ) ;
1828
19- act . Should ( ) . Throw < NotSupportedException > ( ) ;
29+ actualAct . Should ( ) . Throw < NotSupportedException > ( ) ;
2030 }
2131 }
2232}
You can’t perform that action at this time.
0 commit comments