public async Task IsValid(string value, UriKind uriKind, bool expectedValue) { // Arrange var behavior = new UriValidationBehavior { UriKind = uriKind, }; var entry = new Entry { Text = value, Behaviors = { behavior } }; entry.Behaviors.Add(behavior); // Act await behavior.ForceValidate(); // Assert Assert.AreEqual(expectedValue, behavior.IsValid); }
public void IsValid(string value, UriKind uriKind, bool expectedValue) { var behavior = new UriValidationBehavior { UriKind = uriKind, }; new Entry { Text = value, Behaviors = { behavior } }; behavior.ForceValidate(); Assert.Equal(expectedValue, behavior.IsValid); }