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 1
1
using System ;
2
+ using System . Collections . Generic ;
2
3
using FluentAssertions ;
3
4
using LinkDotNet . Blog . Web . RegistrationExtensions ;
4
5
using Microsoft . Extensions . DependencyInjection ;
@@ -8,15 +9,24 @@ namespace LinkDotNet.Blog.UnitTests
8
9
{
9
10
public class StorageProviderRegistrationExtensionsTests
10
11
{
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 )
13
23
{
14
24
var services = new ServiceCollection ( ) ;
15
25
services . UseRavenDbAsStorageProvider ( ) ;
16
26
17
- Action act = ( ) => services . UseSqliteAsStorageProvider ( ) ;
27
+ Action actualAct = ( ) => act ( services ) ;
18
28
19
- act . Should ( ) . Throw < NotSupportedException > ( ) ;
29
+ actualAct . Should ( ) . Throw < NotSupportedException > ( ) ;
20
30
}
21
31
}
22
32
}
You can’t perform that action at this time.
0 commit comments