コード例 #1
0
		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));
		}
コード例 #2
0
		public async void UserName_Update_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.ValidateUpdateAsync(default(int), new ApiErrorLogRequestModel());

			validator.ShouldHaveValidationErrorFor(x => x.UserName, null as string);
		}