public void ClaimedStandardReviewPreviousVersionMustBelongToSolution_Valid_Succeeds() { var validator = new SolutionsExValidator(_context.Object, _logger.Object, _solutionsValidator.Object); var soln = Creator.GetSolutionEx(); var review1 = Creator.GetStandardsApplicableReviews(); var review2 = Creator.GetStandardsApplicableReviews(prevId: review1.Id); soln.ClaimedStandardReview = new List <StandardsApplicableReviews>(new[] { review1, review2 }); validator.ClaimedStandardReviewPreviousVersionMustBelongToSolution(); var valres = validator.Validate(soln); valres.Errors.Should().BeEmpty(); }
public void ClaimedStandardReviewPreviousVersionMustBelongToSolution_Invalid_ReturnsError() { var validator = new SolutionsExValidator(_context.Object, _logger.Object, _solutionsValidator.Object); var soln = Creator.GetSolutionEx(); var review1 = Creator.GetStandardsApplicableReviews(); var review2 = Creator.GetStandardsApplicableReviews(prevId: Guid.NewGuid().ToString()); soln.ClaimedStandardReview = new List <StandardsApplicableReviews>(new[] { review1, review2 }); validator.ClaimedStandardReviewPreviousVersionMustBelongToSolution(); var valres = validator.Validate(soln); valres.Errors.Should() .Contain(x => x.ErrorMessage == "ClaimedStandardReview previous version must belong to solution") .And .HaveCount(1); }