public void SimplePath_IsAsExpectedInError() { var model = new SimplePathTestModel(); var result = Model.Verify(model); result = Model.Verify(model); var failure = result.AssertFailure(); failure[0].Path.ToString().Should().Be(nameof(SimplePathTestModel.IntValue)); }
public void ArrayPath_IsAsExpectedInError() { var simplePath = new SimplePathTestModel(); var model = new ArrayPathTestModel(); model.IntValues = model.IntValues.WithValue(new[] { simplePath }); var result = Model.Verify(model); result = Model.Verify(model); var failure = result.AssertFailure(); failure[0].Path.ToString().Should().Be($"{nameof(ArrayPathTestModel.IntValues)}[0].{nameof(SimplePathTestModel.IntValue)}"); }