File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
test/System.Linq.Dynamic.Core.Tests Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 11using System . IO ;
22using System . Linq . Dynamic . Core . Exceptions ;
3- using System . Net ;
43using System . Reflection ;
54using FluentAssertions ;
65using Xunit ;
76
87namespace System . Linq . Dynamic . Core . Tests ;
98
10- public partial class SecurityTests
9+ public class SecurityTests
1110{
1211 class Message
1312 {
@@ -103,6 +102,29 @@ public void UsingStaticClass_ThrowsException(string selector)
103102 action . Should ( ) . Throw < ParseException > ( ) . WithMessage ( "Type 'System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings' not found" ) ;
104103 }
105104
105+ [ Theory ]
106+ [ InlineData ( "System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings.SettingsProp[\" jwt\" ]" ) ]
107+ [ InlineData ( "System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings.SettingsField[\" jwt\" ]" ) ]
108+ [ InlineData ( "c => System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings.SettingsProp[\" jwt\" ]" ) ]
109+ [ InlineData ( "c => System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings.SettingsField[\" jwt\" ]" ) ]
110+ public void UsingStaticClass_WhenAddedDefaultDynamicLinqCustomTypeProvider_ShouldBeOk ( string selector )
111+ {
112+ // Arrange
113+ var config = new ParsingConfig ( ) ;
114+ config . UseDefaultDynamicLinqCustomTypeProvider ( [ typeof ( Helpers . Models . AppSettings ) ] ) ;
115+
116+ var queryable = new [ ]
117+ {
118+ new Message ( "Alice" , "Bob" )
119+ } . AsQueryable ( ) ;
120+
121+ // Act
122+ Action action = ( ) => queryable . Select ( config , selector ) ;
123+
124+ // Assert
125+ action . Should ( ) . NotThrow ( ) ;
126+ }
127+
106128 [ Theory ]
107129 [ InlineData ( "System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings2.SettingsProp[\" jwt\" ]" ) ]
108130 [ InlineData ( "System.Linq.Dynamic.Core.Tests.Helpers.Models.AppSettings2.SettingsField[\" jwt\" ]" ) ]
You can’t perform that action at this time.
0 commit comments