Ejemplo n.º 1
0
        public async void @Event_Update_null()
        {
            Mock <IDatabaseLogRepository> databaseLogRepository = new Mock <IDatabaseLogRepository>();

            databaseLogRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new DatabaseLog()));

            var validator = new ApiDatabaseLogRequestModelValidator(databaseLogRepository.Object);
            await validator.ValidateUpdateAsync(default(int), new ApiDatabaseLogRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.@Event, null as string);
        }
Ejemplo n.º 2
0
        public async void DatabaseUser_Create_length()
        {
            Mock <IDatabaseLogRepository> databaseLogRepository = new Mock <IDatabaseLogRepository>();

            databaseLogRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new DatabaseLog()));

            var validator = new ApiDatabaseLogRequestModelValidator(databaseLogRepository.Object);
            await validator.ValidateCreateAsync(new ApiDatabaseLogRequestModel());

            validator.ShouldHaveValidationErrorFor(x => x.DatabaseUser, new string('A', 129));
        }