11using EntityDb . Common . Envelopes ;
22using EntityDb . Common . TypeResolvers ;
3+ using Microsoft . Extensions . Options ;
4+ using Moq ;
35using Shouldly ;
46using Xunit ;
57
@@ -14,7 +16,13 @@ public void GivenEmptyHeaders_WhenLoadingType_ThenReturnNull()
1416
1517 var headers = new EnvelopeHeaders ( new Dictionary < string , string > ( ) ) ;
1618
17- var typeResolver = new DefaultPartialTypeResolver ( ) ;
19+ var optionsMock = new Mock < IOptions < DefaultPartialTypeResolverOptions > > ( ) ;
20+
21+ optionsMock
22+ . SetupGet ( x => x . Value )
23+ . Returns ( new DefaultPartialTypeResolverOptions ( ) ) ;
24+
25+ var typeResolver = new DefaultPartialTypeResolver ( optionsMock . Object ) ;
1826
1927 // ACT
2028
@@ -37,7 +45,13 @@ public void GivenFullNames_WhenLoadingType_ThenReturnType()
3745
3846 var headers = EnvelopeHelper . GetEnvelopeHeaders ( expectedType , true , false ) ;
3947
40- var typeResolver = new DefaultPartialTypeResolver ( ) ;
48+ var optionsMock = new Mock < IOptions < DefaultPartialTypeResolverOptions > > ( ) ;
49+
50+ optionsMock
51+ . SetupGet ( x => x . Value )
52+ . Returns ( new DefaultPartialTypeResolverOptions ( ) ) ;
53+
54+ var typeResolver = new DefaultPartialTypeResolver ( optionsMock . Object ) ;
4155
4256 // ACT
4357
@@ -56,7 +70,13 @@ public void GivenMemberInfoName_WhenLoadingType_ThenReturnNull()
5670
5771 var headers = EnvelopeHelper . GetEnvelopeHeaders ( typeof ( object ) , false ) ;
5872
59- var typeResolver = new DefaultPartialTypeResolver ( ) ;
73+ var optionsMock = new Mock < IOptions < DefaultPartialTypeResolverOptions > > ( ) ;
74+
75+ optionsMock
76+ . SetupGet ( x => x . Value )
77+ . Returns ( new DefaultPartialTypeResolverOptions ( ) ) ;
78+
79+ var typeResolver = new DefaultPartialTypeResolver ( optionsMock . Object ) ;
6080
6181 // ACT
6282
@@ -73,7 +93,13 @@ public void GivenNoTypeInformation_WhenLoadingType_ThenReturnNull()
7393 {
7494 // ARRANGE
7595
76- var typeResolver = new DefaultPartialTypeResolver ( ) ;
96+ var optionsMock = new Mock < IOptions < DefaultPartialTypeResolverOptions > > ( ) ;
97+
98+ optionsMock
99+ . SetupGet ( x => x . Value )
100+ . Returns ( new DefaultPartialTypeResolverOptions ( ) ) ;
101+
102+ var typeResolver = new DefaultPartialTypeResolver ( optionsMock . Object ) ;
77103
78104 var envelopeHeaders = new EnvelopeHeaders ( new Dictionary < string , string >
79105 {
@@ -95,7 +121,13 @@ public void GivenGarbageTypeInformation_WhenLoadingType_ThenThrow()
95121 {
96122 // ARRANGE
97123
98- var typeResolver = new DefaultPartialTypeResolver ( ) ;
124+ var optionsMock = new Mock < IOptions < DefaultPartialTypeResolverOptions > > ( ) ;
125+
126+ optionsMock
127+ . SetupGet ( x => x . Value )
128+ . Returns ( new DefaultPartialTypeResolverOptions ( ) ) ;
129+
130+ var typeResolver = new DefaultPartialTypeResolver ( optionsMock . Object ) ;
99131
100132 var envelopeHeaders = new EnvelopeHeaders ( new Dictionary < string , string >
101133 {
0 commit comments