File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed
LinkDotNet.Blog.TestUtilities
LinkDotNet.Blog.UnitTests/Domain Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ using LinkDotNet . Domain ;
2
+
3
+ namespace LinkDotNet . Blog . TestUtilities
4
+ {
5
+ public class ProfileInformationEntryBuilder
6
+ {
7
+ private string key = "Key" ;
8
+ private string value = "Value" ;
9
+
10
+ public ProfileInformationEntryBuilder WithKey ( string key )
11
+ {
12
+ this . key = key ;
13
+ return this ;
14
+ }
15
+
16
+ public ProfileInformationEntryBuilder WithValue ( string value )
17
+ {
18
+ this . value = value ;
19
+ return this ;
20
+ }
21
+
22
+ public ProfileInformationEntry Build ( )
23
+ {
24
+ return ProfileInformationEntry . Create ( key , value ) ;
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using FluentAssertions ;
3
+ using LinkDotNet . Domain ;
4
+ using Xunit ;
5
+
6
+ namespace LinkDotNet . Blog . UnitTests . Domain
7
+ {
8
+ public class ProfileInformationEntryTests
9
+ {
10
+ [ Fact ]
11
+ public void ShouldCreateObject ( )
12
+ {
13
+ var result = ProfileInformationEntry . Create ( "key" , "value" ) ;
14
+
15
+ result . Key . Should ( ) . Be ( "key" ) ;
16
+ result . Value . Should ( ) . Be ( "value" ) ;
17
+ }
18
+
19
+ [ Theory ]
20
+ [ InlineData ( "" , "V" ) ]
21
+ [ InlineData ( " " , "V" ) ]
22
+ [ InlineData ( null , "V" ) ]
23
+ [ InlineData ( "K" , "" ) ]
24
+ [ InlineData ( "K" , " " ) ]
25
+ [ InlineData ( "K" , null ) ]
26
+ public void ShouldThrowExceptionWhenEmptyKeyOrValue ( string key , string value )
27
+ {
28
+ Action act = ( ) => ProfileInformationEntry . Create ( key , value ) ;
29
+
30
+ act . Should ( ) . Throw < ArgumentOutOfRangeException > ( ) ;
31
+ }
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments