public async Task Should_not_add_error_if_json_is_valid() { var sut = new JsonField(1, "my-json", Partitioning.Invariant); await sut.ValidateAsync(CreateValue(new JValue(1)), errors); Assert.Empty(errors); }
public async Task Should_add_errors_if_json_is_required() { var sut = new JsonField(1, "my-json", Partitioning.Invariant, new JsonFieldProperties { IsRequired = true }); await sut.ValidateAsync(CreateValue(JValue.CreateNull()), errors); errors.ShouldBeEquivalentTo( new[] { "<FIELD> is required." }); }
public void Should_clone_object() { var sut = new JsonField(1, "my-json", Partitioning.Invariant); Assert.NotEqual(sut, sut.Enable()); }
public void Should_instantiate_field() { var sut = new JsonField(1, "my-json", Partitioning.Invariant); Assert.Equal("my-json", sut.Name); }