private async void BeUniqueByExternalId_Create_Not_Exists() { Mock <IBucketRepository> bucketRepository = new Mock <IBucketRepository>(); bucketRepository.Setup(x => x.ByExternalId(It.IsAny <Guid>())).Returns(Task.FromResult <Bucket>(null)); var validator = new ApiBucketServerRequestModelValidator(bucketRepository.Object); await validator.ValidateCreateAsync(new ApiBucketServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.ExternalId, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da")); }
public async void Name_Create_length() { Mock <IBucketRepository> bucketRepository = new Mock <IBucketRepository>(); bucketRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Bucket())); var validator = new ApiBucketServerRequestModelValidator(bucketRepository.Object); await validator.ValidateCreateAsync(new ApiBucketServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 256)); }