@@ -30,5 +30,64 @@ public void RootPropertiesShouldSerialize()
30
30
) ;
31
31
this . DefaultResponseAssertations ( result ) ;
32
32
}
33
+
34
+ [ Test ]
35
+ public void DynamicAllowSetAndGet ( )
36
+ {
37
+ var result = this . _client . MapFluent < ElasticSearchProject > ( m => m
38
+ . TypeName ( "elasticsearchprojects_allow" )
39
+ . IndexNames ( ElasticsearchConfiguration . DefaultIndex , ElasticsearchConfiguration . DefaultIndex )
40
+ . Dynamic ( DynamicMappingOption . allow )
41
+ ) ;
42
+ this . DefaultResponseAssertations ( result ) ;
43
+ var getResult = this . _client . GetMapping ( ElasticsearchConfiguration . DefaultIndex , "elasticsearchprojects_allow" ) ;
44
+ Assert . AreEqual ( getResult . Dynamic , DynamicMappingOption . allow ) ;
45
+
46
+ result = this . _client . MapFluent < ElasticSearchProject > ( m => m
47
+ . TypeName ( "elasticsearchprojects_allow2" )
48
+ . IndexNames ( ElasticsearchConfiguration . DefaultIndex , ElasticsearchConfiguration . DefaultIndex )
49
+ . Dynamic ( true )
50
+ ) ;
51
+ this . DefaultResponseAssertations ( result ) ;
52
+ getResult = this . _client . GetMapping ( ElasticsearchConfiguration . DefaultIndex , "elasticsearchprojects_allow2" ) ;
53
+ Assert . AreEqual ( getResult . Dynamic , DynamicMappingOption . allow ) ;
54
+
55
+ }
56
+
57
+ [ Test ]
58
+ public void DynamicIgnoreSetAndGet ( )
59
+ {
60
+ var result = this . _client . MapFluent < ElasticSearchProject > ( m => m
61
+ . TypeName ( "elasticsearchprojects_ignore" )
62
+ . IndexNames ( ElasticsearchConfiguration . DefaultIndex , ElasticsearchConfiguration . DefaultIndex )
63
+ . Dynamic ( DynamicMappingOption . ignore )
64
+ ) ;
65
+ this . DefaultResponseAssertations ( result ) ;
66
+ var getResult = this . _client . GetMapping ( ElasticsearchConfiguration . DefaultIndex , "elasticsearchprojects_ignore" ) ;
67
+ Assert . AreEqual ( getResult . Dynamic , DynamicMappingOption . ignore ) ;
68
+
69
+ result = this . _client . MapFluent < ElasticSearchProject > ( m => m
70
+ . TypeName ( "elasticsearchprojects_ignore2" )
71
+ . IndexNames ( ElasticsearchConfiguration . DefaultIndex , ElasticsearchConfiguration . DefaultIndex )
72
+ . Dynamic ( false )
73
+ ) ;
74
+ this . DefaultResponseAssertations ( result ) ;
75
+ getResult = this . _client . GetMapping ( ElasticsearchConfiguration . DefaultIndex , "elasticsearchprojects_ignore2" ) ;
76
+ Assert . AreEqual ( getResult . Dynamic , DynamicMappingOption . ignore ) ;
77
+
78
+ }
79
+ [ Test ]
80
+ public void DynamicStrictSetAndGet ( )
81
+ {
82
+ var result = this . _client . MapFluent < ElasticSearchProject > ( m => m
83
+ . TypeName ( "elasticsearchprojects_strict" )
84
+ . IndexNames ( ElasticsearchConfiguration . DefaultIndex , ElasticsearchConfiguration . DefaultIndex )
85
+ . Dynamic ( DynamicMappingOption . strict )
86
+ ) ;
87
+ this . DefaultResponseAssertations ( result ) ;
88
+ var getResult = this . _client . GetMapping ( ElasticsearchConfiguration . DefaultIndex , "elasticsearchprojects_strict" ) ;
89
+ Assert . AreEqual ( getResult . Dynamic , DynamicMappingOption . strict ) ;
90
+
91
+ }
33
92
}
34
93
}
0 commit comments