1
1
namespace MyTested . AspNetCore . Mvc . Builders . Data
2
2
{
3
+ using System ;
3
4
using System . Collections . Generic ;
4
5
using Base ;
5
6
using Exceptions ;
@@ -79,11 +80,20 @@ protected void ValidateContainingEntryWithValue<TValue>(TValue value)
79
80
value ,
80
81
this . ThrowNewDataProviderAssertionException ) ;
81
82
83
+ /// <summary>
84
+ /// Validates whether the data provider contains entry value with the given type.
85
+ /// </summary>
86
+ protected void ValidateContainingEntryOfType ( Type valueType )
87
+ => DictionaryValidator . ValidateValueOfType (
88
+ this . DataProviderName ,
89
+ this . DataProvider ,
90
+ this . ThrowNewDataProviderAssertionException , valueType ) ;
91
+
82
92
/// <summary>
83
93
/// Validates whether the data provider contains entry value with the given type.
84
94
/// </summary>
85
95
/// <typeparam name="TValue">Type of the value.</typeparam>
86
- protected void ValidateContainingEntryOfType < TValue > ( )
96
+ protected void ValidateContainingEntryOfType < TValue > ( )
87
97
=> DictionaryValidator . ValidateValueOfType < TValue > (
88
98
this . DataProviderName ,
89
99
this . DataProvider ,
@@ -101,6 +111,18 @@ protected void ValidateContainingEntryOfType<TValue>(string key)
101
111
key ,
102
112
this . ThrowNewDataProviderAssertionException ) ;
103
113
114
+ /// <summary>
115
+ /// Validates whether the data provider contains entry value with the given type and corresponding key.
116
+ /// </summary>
117
+ /// <param name="key"></param>
118
+ /// <param name="valueType"></param>
119
+ protected void ValidateContainingEntryOfType ( string key , Type valueType )
120
+ => DictionaryValidator . ValidateStringKeyAndValueOfType (
121
+ this . DataProviderName ,
122
+ this . DataProvider ,
123
+ key ,
124
+ this . ThrowNewDataProviderAssertionException , valueType ) ;
125
+
104
126
/// <summary>
105
127
/// Validates whether the data provider contains entry with the given key and corresponding value.
106
128
/// </summary>
0 commit comments