Beispiel #1
0
        public void MustBeValidPreviousId_Null_Succeeds()
        {
            var validator = new DummyReviewsValidatorBase(_reviewsDatastore.Object, _evidenceDatastore.Object, _claimDatastore.Object, _solutionDatastore.Object, _context.Object, _logger.Object);
            var review    = Creator.GetReviewsBase(prevId: null);

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

            valres.Errors.Should().BeEmpty();
        }
Beispiel #2
0
        public void MustBeValidPreviousId_NotGuid_ReturnsError()
        {
            var validator = new DummyReviewsValidatorBase(_reviewsDatastore.Object, _evidenceDatastore.Object, _claimDatastore.Object, _solutionDatastore.Object, _context.Object, _logger.Object);
            var review    = Creator.GetReviewsBase(prevId: "not a GUID");

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

            valres.Errors.Should()
            .ContainSingle(x => x.ErrorMessage == "Invalid PreviousId")
            .And
            .HaveCount(1);
        }