public void MustBeSameOrganisation_Buyer_Ignored(string role)
        {
            var orgId = Guid.NewGuid().ToString();
            var ctx   = Creator.GetContext(role: role);

            _context.Setup(c => c.HttpContext).Returns(ctx);
            var claimId   = Guid.NewGuid().ToString();
            var validator = new DummyClaimsEvidenceBlobStoreValidatorBase(_context.Object, _logger.Object, _solutionsDatastore.Object, _claimsDatastore.Object);

            validator.MustBeSameOrganisation();
            var valres = validator.Validate(claimId);

            valres.Errors.Should().BeEmpty();
            _claimsDatastore.Verify(x => x.ById(It.IsAny <string>()), Times.Never);
            _solutionsDatastore.Verify(x => x.ById(It.IsAny <string>()), Times.Never);
        }
        public void MustBeSameOrganisation_Same_NonBuyer_Succeeds(string role)
        {
            var orgId = Guid.NewGuid().ToString();
            var ctx   = Creator.GetContext(orgId: orgId, role: role);

            _context.Setup(c => c.HttpContext).Returns(ctx);
            var claimId = Guid.NewGuid().ToString();
            var claim   = Creator.GetClaimsBase();

            _claimsDatastore.Setup(x => x.ById(claimId)).Returns(claim);
            var soln = Creator.GetSolution(orgId: orgId);

            _solutionsDatastore.Setup(x => x.ById(claim.SolutionId)).Returns(soln);
            var validator = new DummyClaimsEvidenceBlobStoreValidatorBase(_context.Object, _logger.Object, _solutionsDatastore.Object, _claimsDatastore.Object);

            validator.MustBeSameOrganisation();
            var valres = validator.Validate(claimId);

            valres.Errors.Should().BeEmpty();
        }
        public void MustBeSameOrganisation_Different_Supplier_ReturnsError(string role)
        {
            var orgId = Guid.NewGuid().ToString();
            var ctx   = Creator.GetContext(role: role);

            _context.Setup(c => c.HttpContext).Returns(ctx);
            var claimId = Guid.NewGuid().ToString();
            var claim   = Creator.GetClaimsBase();

            _claimsDatastore.Setup(x => x.ById(claimId)).Returns(claim);
            var soln = Creator.GetSolution(orgId: orgId);

            _solutionsDatastore.Setup(x => x.ById(claim.SolutionId)).Returns(soln);
            var validator = new DummyClaimsEvidenceBlobStoreValidatorBase(_context.Object, _logger.Object, _solutionsDatastore.Object, _claimsDatastore.Object);

            validator.MustBeSameOrganisation();
            var valres = validator.Validate(claimId);

            valres.Errors.Should()
            .ContainSingle(x => x.ErrorMessage == "Cannot add/see evidence for other organisation")
            .And
            .HaveCount(1);
        }