Implemented interface member:
326 references to
FormatterWebSite (7)
Controllers\ValidationController.cs (5)
16
return Content(ModelState
[
"Id"].Errors[0].ErrorMessage + "," +
17
ModelState
[
"Name"].Errors[0].ErrorMessage + "," +
18
ModelState
[
"Alias"].Errors[0].ErrorMessage + "," +
19
ModelState
[
"Designation"].Errors[0].ErrorMessage);
53
return ModelState
[
"Name"].Errors[0].ErrorMessage;
ValidateBodyParameterAttribute.cs (2)
24
var parameterBindingErrors = context.ModelState
[
bodyParameter.Name]?.Errors ??
25
context.ModelState
[
string.Empty]?.Errors;
Microsoft.AspNetCore.Mvc.Abstractions.Test (65)
ModelBinding\ModelStateDictionaryTest.cs (65)
75
var result = modelStateDictionary
[
key];
101
var result = modelStateDictionary
[
key];
153
Assert.Equal(ModelValidationState.Skipped, source
[
"key"].ValidationState);
167
Assert.Equal(ModelValidationState.Skipped, source
[
"key"].ValidationState);
182
Assert.Equal(ModelValidationState.Skipped, source
[
"key"].ValidationState);
212
Assert.Equal(ModelValidationState.Valid, source
[
"key"].ValidationState);
226
Assert.Equal(ModelValidationState.Valid, source
[
"key"].ValidationState);
241
Assert.Equal(ModelValidationState.Valid, source
[
"key"].ValidationState);
266
var entry = source
[
"key"];
278
var actual = target
[
"key"];
354
Assert.Equal("bar", newDictionary
[
"foo"].RawValue);
566
var item = dictionary1
[
"foo"];
570
item = dictionary1
[
"bar"];
598
var item = dictionary1
[
"other-key"];
603
item = dictionary1
[
key];
636
var modelState = dictionary
[
"some key"];
656
var modelState = dictionary
[
"some key"];
769
var error = Assert.Single(dictionary
[
string.Empty].Errors);
798
var error = Assert.Single(dictionary
[
string.Empty].Errors);
839
var error = Assert.Single(dictionary
[
string.Empty].Errors);
870
var error = Assert.Single(dictionary
[
string.Empty].Errors);
875
error = Assert.Single(dictionary
[
"key3"].Errors);
903
var error = Assert.Single(dictionary
[
string.Empty].Errors);
929
var error = Assert.Single(copy
[
string.Empty].Errors);
969
var error = Assert.Single(dictionary
[
"key"].Errors);
986
var error = Assert.Single(dictionary
[
"key"].Errors);
1082
var error = Assert.Single(dictionary
[
"key"].Errors);
1100
var error = Assert.Single(dictionary
[
"key"].Errors);
1200
var error = Assert.Single(dictionary
[
"key"].Errors);
1296
Assert.Empty(dictionary
[
"Property1"].Errors);
1297
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property1"].ValidationState);
1298
Assert.Empty(dictionary
[
"Property2"].Errors);
1299
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property2"].ValidationState);
1300
Assert.Single(dictionary
[
"Property3"].Errors);
1301
Assert.Equal(ModelValidationState.Invalid, dictionary
[
"Property3"].ValidationState);
1302
Assert.Empty(dictionary
[
"Property4"].Errors);
1303
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property4"].ValidationState);
1323
Assert.Empty(dictionary
[
"Product"].Errors);
1324
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product"].ValidationState);
1325
Assert.Empty(dictionary
[
"Product.Detail1"].Errors);
1326
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail1"].ValidationState);
1327
Assert.Empty(dictionary
[
"Product.Detail2[0]"].Errors);
1328
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail2[0]"].ValidationState);
1329
Assert.Empty(dictionary
[
"Product.Detail2[1]"].Errors);
1330
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail2[1]"].ValidationState);
1331
Assert.Empty(dictionary
[
"Product.Detail2[2]"].Errors);
1332
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail2[2]"].ValidationState);
1333
Assert.Empty(dictionary
[
"Product.Detail3"].Errors);
1334
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail3"].ValidationState);
1335
Assert.Single(dictionary
[
"ProductName"].Errors);
1336
Assert.Equal(ModelValidationState.Invalid, dictionary
[
"ProductName"].ValidationState);
1353
Assert.Equal(ModelValidationState.Valid, dictionary
[
"Product"].ValidationState);
1354
Assert.Empty(dictionary
[
"Product.Detail1"].Errors);
1355
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail1"].ValidationState);
1356
Assert.Empty(dictionary
[
"Product.Detail1.Name"].Errors);
1357
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Product.Detail1.Name"].ValidationState);
1358
Assert.Equal(ModelValidationState.Skipped, dictionary
[
"Product.Detail1Name"].ValidationState);
1377
Assert.Empty(dictionary
[
"Property1"].Errors);
1378
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property1"].ValidationState);
1379
Assert.Empty(dictionary
[
"Property2"].Errors);
1380
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property2"].ValidationState);
1381
Assert.Empty(dictionary
[
"Property3"].Errors);
1382
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property3"].ValidationState);
1383
Assert.Empty(dictionary
[
"Property4"].Errors);
1384
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Property4"].ValidationState);
Microsoft.AspNetCore.Mvc.Core (3)
ModelBinding\ModelBindingHelper.cs (1)
425
var entry = modelState
[
string.Empty];
ModelBinding\Validation\ValidationVisitor.cs (2)
178
var entry = ModelState
[
key];
251
var entry = ModelState
[
Key];
Microsoft.AspNetCore.Mvc.Core.Test (133)
ControllerBaseTest.cs (2)
3117
var error = Assert.Single(controller.ModelState
[
"Prefix.IntegerProperty"].Errors);
3154
var error = Assert.Single(controller.ModelState
[
"IntegerProperty"].Errors);
Controllers\ControllerBinderDelegateProviderTest.cs (2)
419
controllerContext.ModelState
[
"memberName"].Errors.Single().ErrorMessage);
515
controllerContext.ModelState
[
"memberName"].Errors.Single().ErrorMessage);
Formatters\JsonInputFormatterTestBase.cs (2)
435
var error = Assert.Single(formatterContext.ModelState
[
""].Errors);
534
Assert.Single(formatterContext.ModelState
[
"Person.Name"].Errors);
Formatters\SystemTextJsonInputFormatterTest.cs (2)
157
var modelError = formatterContext.ModelState
[
modelStateKey].Errors.Single();
179
var modelError = formatterContext.ModelState
[
"$"].Errors.Single();
Formatters\TextInputFormatterTest.cs (2)
35
Assert.Single(context.ModelState
[
"something"].Errors);
37
var error = context.ModelState
[
"something"].Errors[0];
ModelBinding\Binders\BodyModelBinderTests.cs (2)
243
Assert.Single(bindingContext.ModelState
[
bindingContext.BinderModelName].Errors);
244
Assert.Equal("Unsupported content type ''.", bindingContext.ModelState
[
bindingContext.BinderModelName].Errors[0].Exception.Message);
ModelBinding\Binders\ByteArrayModelBinderTests.cs (1)
77
var error = Assert.Single(bindingContext.ModelState
[
"foo"].Errors);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (3)
1058
bindingContext.ModelState
[
"foo"].Errors[0].Exception.Message);
1079
Assert.Single(bindingContext.ModelState
[
"foo.NameNoAttribute"].Errors);
1081
bindingContext.ModelState
[
"foo.NameNoAttribute"].Errors[0].Exception.Message);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (3)
1220
bindingContext.ModelState
[
"foo"].Errors[0].Exception.Message);
1241
Assert.Single(bindingContext.ModelState
[
"foo.NameNoAttribute"].Errors);
1243
bindingContext.ModelState
[
"foo.NameNoAttribute"].Errors[0].Exception.Message);
ModelBinding\Binders\DateTimeModelBinderTest.cs (3)
49
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
71
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
127
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
ModelBinding\Binders\EnumTypeModelBinderTest.cs (3)
43
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
148
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
231
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (6)
71
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
94
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
118
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
142
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
166
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
208
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
ModelBinding\Binders\HeaderModelBinderTests.cs (2)
292
var entry = bindingContext.ModelState
[
"someprefix.Header"];
316
var entry = bindingContext.ModelState
[
"someprefix.Header"];
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (2)
32
var error = Assert.Single(bindingContext.ModelState
[
"someName.Key"].Errors);
56
var state = bindingContext.ModelState
[
"someName.Value"];
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (3)
129
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
154
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
375
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (5)
78
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
103
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
301
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
406
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
456
var error = Assert.Single(bindingContext.ModelState
[
"theModelName"].Errors);
ModelBinding\ModelBindingHelperTest.cs (29)
84
var error = Assert.Single(modelState
[
"MyProperty"].Errors);
654
Assert.Empty(dictionary
[
"Name"].Errors);
655
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Name"].ValidationState);
656
Assert.Empty(dictionary
[
"Id"].Errors);
657
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Id"].ValidationState);
658
Assert.Empty(dictionary
[
"Category"].Errors);
659
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"Category"].ValidationState);
661
Assert.Single(dictionary
[
"Unrelated"].Errors);
662
Assert.Equal(ModelValidationState.Invalid, dictionary
[
"Unrelated"].ValidationState);
683
Assert.Empty(dictionary
[
string.Empty].Errors);
684
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
string.Empty].ValidationState);
686
Assert.Single(dictionary
[
"Unrelated"].Errors);
687
Assert.Equal(ModelValidationState.Invalid, dictionary
[
"Unrelated"].ValidationState);
714
Assert.Empty(dictionary
[
"[0].Name"].Errors);
715
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[0].Name"].ValidationState);
716
Assert.Empty(dictionary
[
"[0].Id"].Errors);
717
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[0].Id"].ValidationState);
718
Assert.Empty(dictionary
[
"[0].Category"].Errors);
719
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[0].Category"].ValidationState);
720
Assert.Empty(dictionary
[
"[1].Name"].Errors);
721
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[1].Name"].ValidationState);
722
Assert.Empty(dictionary
[
"[1].Id"].Errors);
723
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[1].Id"].ValidationState);
724
Assert.Empty(dictionary
[
"[1].Category"].Errors);
725
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
"[1].Category"].ValidationState);
727
Assert.Single(dictionary
[
"Unrelated"].Errors);
728
Assert.Equal(ModelValidationState.Invalid, dictionary
[
"Unrelated"].ValidationState);
763
Assert.Empty(dictionary
[
entry].Errors);
764
Assert.Equal(ModelValidationState.Unvalidated, dictionary
[
entry].ValidationState);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (61)
42
var entry = modelState
[
"parameter"];
69
var entry = modelState
[
"parameter"];
98
var entry = modelState
[
"parameter"];
125
var entry = modelState
[
"parameter"];
175
var entry = modelState
[
"parameter.Reference"];
179
entry = modelState
[
"parameter.Value"];
207
var entry = modelState
[
"parameter.Reference"];
211
entry = modelState
[
"parameter.Value"];
237
var entry = modelState
[
"Name"];
242
entry = modelState
[
"Profession"];
280
var entry = modelState
[
"person.Name"];
284
entry = modelState
[
"person.Address.Street"];
312
var entry = modelState
[
"parameter.Street"];
344
var entry = modelState
[
"Street"];
376
var entry = modelState
[
"Name"];
379
entry = modelState
[
"Profession"];
384
entry = modelState
[
"Friend.Name"];
389
entry = modelState
[
"Friend.Profession"];
489
var entry = modelState
[
"parameter"];
494
entry = modelState
[
"parameter.Property1"];
499
entry = modelState
[
"parameter.Property2"];
504
entry = modelState
[
"parameter.Property3"];
635
var entry = modelState
[
"parameter"];
666
var entry = modelState
[
"parameter.Name"];
670
entry = modelState
[
"parameter.Profession"];
702
var entry = modelState
[
"parameter.Name"];
706
entry = modelState
[
"parameter.Profession"];
742
var entry = modelState
[
string.Empty];
772
var entry = modelState
[
"parameter[0]"];
776
entry = modelState
[
"parameter[0]"];
803
var entry = modelState
[
"[0].Name"];
808
entry = modelState
[
"[0].Profession"];
813
entry = modelState
[
"[1].Name"];
818
entry = modelState
[
"[1].Profession"];
846
var entry = modelState
[
"[0].Name"];
851
entry = modelState
[
"[0].Profession"];
856
entry = modelState
[
"[1].Name"];
861
entry = modelState
[
"[1].Profession"];
928
var entry = modelState
[
"items[0]"];
932
entry = modelState
[
"items[1]"];
936
entry = modelState
[
"items[2]"];
1004
var entry = modelState
[
"items[0].Key"];
1008
entry = modelState
[
"items[0].Value"];
1012
entry = modelState
[
"items[1].Key"];
1016
entry = modelState
[
"items[1].Value"];
1052
var entry = modelState
[
"[0].Key"];
1056
entry = modelState
[
"[1].Key"];
1060
entry = modelState
[
"[0].Value.Name"];
1065
entry = modelState
[
"[0].Value.Profession"];
1070
entry = modelState
[
"[1].Value.Name"];
1075
entry = modelState
[
"[1].Value.Profession"];
1151
var entry = modelState
[
"user.Password"];
1181
var entry = modelState
[
"userIds[0]"];
1381
var entry = modelState
[
"Property1"];
1384
entry = modelState
[
"Property2"];
1402
modelState
[
"Property2"].ValidationState = ModelValidationState.Skipped;
1411
var entry = modelState
[
"Property1"];
1414
entry = modelState
[
"Property2"];
1432
modelState
[
"Property2"].ValidationState = ModelValidationState.Invalid;
1441
var entry = modelState
[
"Property1"];
1444
entry = modelState
[
"Property2"];
Microsoft.AspNetCore.Mvc.IntegrationTests (102)
ActionParametersIntegrationTest.cs (21)
69
Assert.Equal("SomeStreet", modelState
[
key].AttemptedValue);
70
Assert.Equal("SomeStreet", modelState
[
key].RawValue);
71
Assert.Empty(modelState
[
key].Errors);
72
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
163
Assert.Equal("SomeStreet", modelState
[
key].AttemptedValue);
164
Assert.Equal("SomeStreet", modelState
[
key].RawValue);
165
Assert.Empty(modelState
[
key].Errors);
166
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
249
Assert.Equal("SomeStreet", modelState
[
key].AttemptedValue);
250
Assert.Equal("SomeStreet", modelState
[
key].RawValue);
251
Assert.Empty(modelState
[
key].Errors);
252
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
340
Assert.Equal("SomeStreet", modelState
[
key].AttemptedValue);
341
Assert.Equal("SomeStreet", modelState
[
key].RawValue);
342
Assert.Empty(modelState
[
key].Errors);
343
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
795
var entry = modelState
[
paramName];
836
var entry = modelState
[
string.Empty];
841
entry = modelState
[
nameof(ModelWithIValidatableObject.FirstName)];
881
var entry = modelState
[
parameter.Name];
886
entry = modelState
[
ModelNames.CreatePropertyModelName(parameter.Name, nameof(ModelWithIValidatableObject.FirstName))];
BinderTypeBasedModelBinderIntegrationTest.cs (6)
118
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
119
Assert.NotNull(modelState
[
key].RawValue); // Value is set by test model binder, no need to validate it.
273
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
274
Assert.NotNull(modelState
[
key].RawValue); // Value is set by test model binder, no need to validate it.
312
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
313
Assert.NotNull(modelState
[
key].RawValue); // Value is set by test model binder, no need to validate it.
BindPropertyIntegrationTest.cs (1)
295
var message = testContext.ModelState
[
propertyName].Errors.Single().ErrorMessage;
BodyValidationIntegrationTests.cs (2)
391
var error = Assert.Single(modelState
[
key].Errors);
587
var state = modelState
[
"CustomParameter.Address.Number"];
ComplexRecordIntegrationTest.cs (9)
1994
var error = Assert.Single(modelState
[
"Customer"].Errors);
2050
var error = Assert.Single(modelState
[
"Customer"].Errors);
2108
var error = Assert.Single(modelState
[
"parameter.Customer.Name"].Errors);
2162
var error = Assert.Single(modelState
[
"Customer.Name"].Errors);
2220
var error = Assert.Single(modelState
[
"customParameter.Customer.Name"].Errors);
2270
var error = Assert.Single(modelState
[
"ProductName"].Errors);
2322
var error = Assert.Single(modelState
[
"customParameter.ProductName"].Errors);
2418
var error = Assert.Single(modelState
[
"OrderIds"].Errors);
2470
var error = Assert.Single(modelState
[
"customParameter.OrderIds"].Errors);
ComplexTypeIntegrationTestBase.cs (9)
2148
var error = Assert.Single(modelState
[
"Customer"].Errors);
2203
var error = Assert.Single(modelState
[
"Customer"].Errors);
2270
var error = Assert.Single(modelState
[
"parameter.Customer.Name"].Errors);
2324
var error = Assert.Single(modelState
[
"Customer.Name"].Errors);
2382
var error = Assert.Single(modelState
[
"customParameter.Customer.Name"].Errors);
2436
var error = Assert.Single(modelState
[
"ProductName"].Errors);
2488
var error = Assert.Single(modelState
[
"customParameter.ProductName"].Errors);
2588
var error = Assert.Single(modelState
[
"OrderIds"].Errors);
2640
var error = Assert.Single(modelState
[
"customParameter.OrderIds"].Errors);
DictionaryModelBinderIntegrationTest.cs (2)
1387
Assert.Equal("Invalid is not a valid value for DayOfWeek.", modelState
[
"parameter"].Errors[0].ErrorMessage);
1425
Assert.Equal("The value 'BadEnumValue' is not valid for Value.", modelState
[
"parameter[exclamation]"].Errors[0].ErrorMessage);
FormFileModelBindingIntegrationTest.cs (3)
69
Assert.Null(modelState
[
key].RawValue);
70
Assert.Empty(modelState
[
key].Errors);
71
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
HeaderModelBinderIntegrationTest.cs (1)
62
var error = Assert.Single(modelState
[
key].Errors);
SimpleTypeModelBinderIntegrationTest.cs (44)
60
Assert.Equal("1", modelState
[
key].AttemptedValue);
61
Assert.Equal("1", modelState
[
key].RawValue);
62
Assert.Empty(modelState
[
key].Errors);
63
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
104
Assert.Equal("1", modelState
[
key].AttemptedValue);
105
Assert.Equal("1", modelState
[
key].RawValue);
106
Assert.Empty(modelState
[
key].Errors);
107
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
148
Assert.Equal("someValue", modelState
[
key].AttemptedValue);
149
Assert.Equal("someValue", modelState
[
key].RawValue);
150
Assert.Empty(modelState
[
key].Errors);
151
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
225
Assert.Equal("32,000.99", modelState
[
key].AttemptedValue);
226
Assert.Equal("32,000.99", modelState
[
key].RawValue);
227
Assert.Empty(modelState
[
key].Errors);
228
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
269
Assert.Equal("2020-02-01", modelState
[
key].AttemptedValue);
270
Assert.Equal("2020-02-01", modelState
[
key].RawValue);
271
Assert.Empty(modelState
[
key].Errors);
272
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
354
Assert.Equal("someValue,otherValue", modelState
[
key].AttemptedValue);
355
Assert.Equal(new string[] { "someValue", "otherValue" }, modelState
[
key].RawValue);
356
Assert.Empty(modelState
[
key].Errors);
357
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
399
var entry = modelState
[
key];
459
var entry = modelState
[
key];
504
Assert.Equal("", modelState
[
key].AttemptedValue);
505
Assert.Equal("", modelState
[
key].RawValue);
506
var error = Assert.Single(modelState
[
key].Errors);
558
Assert.Equal(string.Empty, modelState
[
key].AttemptedValue);
559
Assert.Equal(string.Empty, modelState
[
key].RawValue);
560
var error = Assert.Single(modelState
[
key].Errors);
601
Assert.Equal(string.Empty, modelState
[
key].AttemptedValue);
602
Assert.Equal(string.Empty, modelState
[
key].RawValue);
603
Assert.Empty(modelState
[
key].Errors);
697
var entry = modelState
[
"Address.Lines"];
743
Assert.Equal("someValue", modelState
[
key].AttemptedValue);
744
Assert.Equal("someValue", modelState
[
key].RawValue);
745
Assert.Empty(modelState
[
key].Errors);
746
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
787
Assert.Equal("someValue", modelState
[
key].AttemptedValue);
788
Assert.Equal("someValue", modelState
[
key].RawValue);
789
Assert.Empty(modelState
[
key].Errors);
790
Assert.Equal(ModelValidationState.Valid, modelState
[
key].ValidationState);
TryUpdateModelIntegrationTest.cs (4)
155
Assert.NotNull(modelState
[
"[0].Name"]);
156
Assert.NotNull(modelState
[
"[1].Address.Street"]);
755
Assert.NotNull(modelState
[
"prefix[0].Name"]);
756
Assert.NotNull(modelState
[
"prefix[1].Address.Street"]);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (11)
JsonPatchExtensionsTest.cs (2)
26
var error = Assert.Single(modelState
[
"Customer"].Errors);
44
var error = Assert.Single(modelState
[
"jsonpatch.Customer"].Errors);
NewtonsoftJsonInputFormatterTest.cs (6)
250
var modelError = formatterContext.ModelState
[
modelStateKey].Errors.Single();
305
var modelError = formatterContext.ModelState
[
string.Empty].Errors.Single();
338
var modelError = formatterContext.ModelState
[
string.Empty].Errors.Single();
369
var modelError = Assert.Single(formatterContext.ModelState
[
"dateValue"].Errors);
400
var modelError = Assert.Single(formatterContext.ModelState
[
"shortValue"].Errors);
431
var modelError = Assert.Single(formatterContext.ModelState
[
"Complex.WithPrimitives[0].shortValue"].Errors);
NewtonsoftJsonPatchInputFormatterTest.cs (1)
219
Assert.Contains(exceptionMessage, formatterContext.ModelState
[
""].Errors[0].ErrorMessage);
src\Mvc\Mvc.Core\test\Formatters\JsonInputFormatterTestBase.cs (2)
435
var error = Assert.Single(formatterContext.ModelState
[
""].Errors);
534
Assert.Single(formatterContext.ModelState
[
"Person.Name"].Errors);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
ModelStateDictionaryExtensionsTest.cs (5)
297
var expected = dictionary
[
"Key"];
317
var expected = dictionary
[
"Key"];
336
var expected = dictionary
[
"child"];
359
var expected = dictionary
[
"Key"];
381
var expected = dictionary
[
"Key"];