コード例 #1
0
        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));
        }
コード例 #2
0
        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)}");
        }