public async void ErrorProcedure_Update_length() { Mock<IErrorLogRepository> errorLogRepository = new Mock<IErrorLogRepository>(); errorLogRepository.Setup(x => x.Get(It.IsAny<int>())).Returns(Task.FromResult(new ErrorLog())); var validator = new ApiErrorLogRequestModelValidator(errorLogRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiErrorLogRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.ErrorProcedure, new string('A', 127)); }
public async void UserName_Create_null() { Mock<IErrorLogRepository> errorLogRepository = new Mock<IErrorLogRepository>(); errorLogRepository.Setup(x => x.Get(It.IsAny<int>())).Returns(Task.FromResult(new ErrorLog())); var validator = new ApiErrorLogRequestModelValidator(errorLogRepository.Object); await validator.ValidateCreateAsync(new ApiErrorLogRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.UserName, null as string); }
public async void ErrorMessage_Create_length() { Mock<IErrorLogRepository> errorLogRepository = new Mock<IErrorLogRepository>(); errorLogRepository.Setup(x => x.Get(It.IsAny<int>())).Returns(Task.FromResult(new ErrorLog())); var validator = new ApiErrorLogRequestModelValidator(errorLogRepository.Object); await validator.ValidateCreateAsync(new ApiErrorLogRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.ErrorMessage, new string('A', 4001)); }