Пример #1
0
        public void MustBeValidOwnerId_Valid_Succeeds()
        {
            var validator = new DummyClaimsValidatorBase(_context.Object, _logger.Object, _claimDatastore.Object, _contactsDatastore.Object, _solutionsDatastore.Object);
            var claim     = Creator.GetClaimsBase();

            validator.MustBeValidOwnerId();
            var valres = validator.Validate(claim);

            valres.Errors.Should().BeEmpty();
        }
Пример #2
0
        public void MustBeValidOwnerId_Empty_ReturnsError()
        {
            var validator = new DummyClaimsValidatorBase(_context.Object, _logger.Object, _claimDatastore.Object, _contactsDatastore.Object, _solutionsDatastore.Object);
            var claim     = Creator.GetClaimsBase(ownerId: string.Empty);

            validator.MustBeValidOwnerId();
            var valres = validator.Validate(claim);

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