public void Allows_Unique_Values() { var validator = new ValueListUniqueValueValidator(); var result = validator.Validate(new JArray(JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "world" })), null, new ColorPickerPropertyEditor(Mock.Of <ILogger>())); Assert.AreEqual(0, result.Count()); }
public void Only_Tests_On_JArray_Of_Item_JObject() { var validator = new ValueListUniqueValueValidator(); var result = validator.Validate(new JArray("hello", "world"), null, new ColorPickerPropertyEditor(Mock.Of <ILogger>())); Assert.AreEqual(0, result.Count()); }
public void Only_Tests_On_JArray_Of_Item_JObject() { var validator = new ValueListUniqueValueValidator(); IEnumerable <ValidationResult> result = validator.Validate( new JArray("hello", "world"), null, ColorPickerPropertyEditor); Assert.AreEqual(0, result.Count()); }
public void Does_Not_Allow_Multiple_Values() { var validator = new ValueListUniqueValueValidator(); IEnumerable <ValidationResult> result = validator.Validate( new JArray( JObject.FromObject(new { value = "hello" }), JObject.FromObject(new { value = "hello" })), null, ColorPickerPropertyEditor); Assert.AreEqual(1, result.Count()); }
public void Only_Tests_On_JArray() { var validator = new ValueListUniqueValueValidator(); IEnumerable <ValidationResult> result = validator.Validate( "hello", null, new ColorPickerPropertyEditor( Mock.Of <IDataValueEditorFactory>(), Mock.Of <IIOHelper>(), new JsonNetSerializer())); Assert.AreEqual(0, result.Count()); }