Browse Source

Update ExpressionObserverTests_DataValidation.cs

fix Validation_Plugins_Send_Correct_Notifications to non 'en-us' CultureInfo.
pull/1241/head
ARSolog 9 years ago
committed by GitHub
parent
commit
8a8a6de9a6
  1. 6
      tests/Avalonia.Markup.UnitTests/Data/ExpressionObserverTests_DataValidation.cs

6
tests/Avalonia.Markup.UnitTests/Data/ExpressionObserverTests_DataValidation.cs

@ -78,6 +78,10 @@ namespace Avalonia.Markup.UnitTests.Data
var data = new IndeiTest();
var observer = new ExpressionObserver(data, nameof(data.MustBePositive), true);
var result = new List<object>();
var errmsg = string.Empty;
try { typeof(IndeiTest).GetProperty(nameof(IndeiTest.MustBePositive)).SetValue(data, "foo"); }
catch(Exception e) { errmsg = e.Message; }
observer.Subscribe(x => result.Add(x));
observer.SetValue(5);
@ -99,7 +103,7 @@ namespace Avalonia.Markup.UnitTests.Data
// Exception is thrown by trying to set value to "foo".
new BindingNotification(
new ArgumentException("Object of type 'System.String' cannot be converted to type 'System.Int32'."),
new ArgumentException(errmsg),
BindingErrorType.DataValidationError),
// Value is set then validation is updated.

Loading…
Cancel
Save