public void Describe_NoError_ReturnsMessageWithNoError() { //Result result = new AnyResult() & new AnyResult() | new AnyResult() & !new FuncResult(false, "No"); var validator = new FakeValidator(); Result result = validator.Validate(JObject.Parse("{ name: 'Peter Pan', age: -1 }"), null); //var visitor = result.Accept(new DescribeFailurePathVisitor()); var visitor = new DescribeFailurePathVisitor(); string description = visitor.Describe(result); Console.WriteLine(description); //Assert.That(description, Is.EqualTo("No Errors.")); }
public void Describe_NoError_ReturnsMessageWithNoError() { //Result result = new AnyResult() & new AnyResult() | new AnyResult() & !new FuncResult(false, "No"); var validator = new FakeValidator(); AbstractDescriptor descriptor = new BasicFakeDescriptor(); Result result = validator.Validate(JObject.Parse("{ name: 'Peter Pan', age: -1, gender: 'mouse' }"), null); //var visitor = result.Accept(new DescribeFailurePathVisitor()); string description = result.Describe <FakeDescribeFailurePath>(); Console.WriteLine(description); string basic = descriptor.Describe(result); Console.WriteLine(basic); //Assert.That(description, Is.EqualTo("No Errors.")); }