public async void StripePlanName_Update_null() { Mock <ISubscriptionRepository> subscriptionRepository = new Mock <ISubscriptionRepository>(); subscriptionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Subscription())); var validator = new ApiSubscriptionServerRequestModelValidator(subscriptionRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiSubscriptionServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.StripePlanName, null as string); }
public async void Name_Create_length() { Mock <ISubscriptionRepository> subscriptionRepository = new Mock <ISubscriptionRepository>(); subscriptionRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Subscription())); var validator = new ApiSubscriptionServerRequestModelValidator(subscriptionRepository.Object); await validator.ValidateCreateAsync(new ApiSubscriptionServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 129)); }