public async void Title_Create_null() { Mock <IVideoRepository> videoRepository = new Mock <IVideoRepository>(); videoRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Video())); var validator = new ApiVideoServerRequestModelValidator(videoRepository.Object); await validator.ValidateCreateAsync(new ApiVideoServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Title, null as string); }
public async void Description_Create_length() { Mock <IVideoRepository> videoRepository = new Mock <IVideoRepository>(); videoRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Video())); var validator = new ApiVideoServerRequestModelValidator(videoRepository.Object); await validator.ValidateCreateAsync(new ApiVideoServerRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Description, new string('A', 4001)); }