コード例 #1
0
        public void MustBeValidEvidenceId_Valid_Succeeds()
        {
            var validator = new DummyReviewsValidatorBase(_reviewsDatastore.Object, _evidenceDatastore.Object, _claimDatastore.Object, _solutionDatastore.Object, _context.Object, _logger.Object);
            var review    = Creator.GetReviewsBase();

            validator.MustBeValidEvidenceId();
            var valres = validator.Validate(review);

            valres.Errors.Should().BeEmpty();
        }
コード例 #2
0
        public void MustBeValidEvidenceId_NotGuid_ReturnsError()
        {
            var validator = new DummyReviewsValidatorBase(_reviewsDatastore.Object, _evidenceDatastore.Object, _claimDatastore.Object, _solutionDatastore.Object, _context.Object, _logger.Object);
            var review    = Creator.GetReviewsBase(evidenceId: "some other Id");

            validator.MustBeValidEvidenceId();
            var valres = validator.Validate(review);

            valres.Errors.Should()
            .ContainSingle(x => x.ErrorMessage == "Invalid EvidenceId")
            .And
            .HaveCount(1);
        }
コード例 #3
0
        public void MustBeValidEvidenceId_Null_ReturnsError()
        {
            var validator = new DummyReviewsValidatorBase(_reviewsDatastore.Object, _evidenceDatastore.Object, _claimDatastore.Object, _solutionDatastore.Object, _context.Object, _logger.Object);
            var review    = Creator.GetReviewsBase();

            review.EvidenceId = null;

            validator.MustBeValidEvidenceId();
            var valres = validator.Validate(review);

            valres.Errors.Should()
            .ContainSingle(x => x.ErrorMessage == "Invalid EvidenceId")
            .And
            .ContainSingle(x => x.ErrorMessage == "'Evidence Id' must not be empty.")
            .And
            .HaveCount(2);
        }