<commit_before>var assert = require('assert');

suite('validator', function() {
	suite('user', function() {
		test('should throws exception if user is empty object', function() {
			var validator = require('./../validator');

			assert.throws(
				function() {
					validator.user({});
				},
				function(error) {
					return error instanceof Error && /User has not property id/.test(error);
				}
			);
		});

		test('should throws exception if user not has own property id', function() {
			var validator = require('./../validator');

			var user = {
				name: '<NAME>'
			};

			assert.throws(
				function() {
					validator.user(user);
				},
				function(error) {
					return error instanceof Error && /User has not property id/.test(error);
				}
			);
		});

		test('should throws exception if user not has own property name', function() {
			var validator = require('./../validator');

			var user = {
				id: 1
			};

			assert.throws(
				function() {
					validator.user(user);
				},
				function(error) {
					return error instanceof Error && /User has not property name/.test(error);
				}
			);
		});

		test('should validate if user has own property name and id', function() {
			var validator = require('./../validator');

			var user = {
				id: 1,
				name: '<NAME>'
			};

			assert.doesNotThrow(
				function() {
					validator.user(user);
				},
				'User is invalid'
			);
		});
	});

	suite('message', function() {
		test('should throws exception if message has not own property target_id', function() {
			var validator = require('./../validator');

			var message = {
				sender_id: 2,
				body: 'Hello World!'
			};

			assert.throws(
				function() {
					validator.message(message);
				},
				function(error) {
					return error instanceof Error && /Message has not property target_id/.test(error);
				}
			);
		});

		test('should throws exception if message has not own property sender_id', function() {
			var validator = require('./../validator');

			var message = {
				target_id: 1,
				body: 'Hello World'
			};

			assert.throws(
				function() {
					validator.message(message);
				},
				function (error) {
					return error instanceof Error && /Message has not property sender_id/.test(error);
				}
			);
		});

		test('should throws exception if message has not own property body', function() {
			var validator = require('./../validator');

			var message = {
				target_id: 1,
				sender_id: 2
			};

			assert.throws(
				function() {
					validator.message(message);
				},
				function(error) {
					return error instanceof Error && /Message has not property body/.test(error);
				}
			);
		});

		test('should validate if message has all properties', function() {
			var validator = require('./../validator');

			var message = {
				target_id: 1,
				sender_id: 2,
				body: 'Hello World!'
			};

			assert.doesNotThrow(
				function() {
					validator.message(message);
				},
				'Message is invalid'
			);
		});
	});
});<commit_msg>Apenas um teste<commit_after>// var assert = require('assert');

// suite('validator', function() {
// 	suite('user', function() {
// 		test('should throws exception if user is empty object', function() {
// 			var validator = require('./../validator');

// 			assert.throws(
// 				function() {
// 					validator.user({});
// 				},
// 				function(error) {
// 					return error instanceof Error && /User has not property id/.test(error);
// 				}
// 			);
// 		});

// 		test('should throws exception if user not has own property id', function() {
// 			var validator = require('./../validator');

// 			var user = {
// 				name: '<NAME>'
// 			};

// 			assert.throws(
// 				function() {
// 					validator.user(user);
// 				},
// 				function(error) {
// 					return error instanceof Error && /User has not property id/.test(error);
// 				}
// 			);
// 		});

// 		test('should throws exception if user not has own property name', function() {
// 			var validator = require('./../validator');

// 			var user = {
// 				id: 1
// 			};

// 			assert.throws(
// 				function() {
// 					validator.user(user);
// 				},
// 				function(error) {
// 					return error instanceof Error && /User has not property name/.test(error);
// 				}
// 			);
// 		});

// 		test('should validate if user has own property name and id', function() {
// 			var validator = require('./../validator');

// 			var user = {
// 				id: 1,
// 				name: '<NAME>'
// 			};

// 			assert.doesNotThrow(
// 				function() {
// 					validator.user(user);
// 				},
// 				'User is invalid'
// 			);
// 		});
// 	});

// 	suite('message', function() {
// 		test('should throws exception if message has not own property target_id', function() {
// 			var validator = require('./../validator');

// 			var message = {
// 				sender_id: 2,
// 				body: 'Hello World!'
// 			};

// 			assert.throws(
// 				function() {
// 					validator.message(message);
// 				},
// 				function(error) {
// 					return error instanceof Error && /Message has not property target_id/.test(error);
// 				}
// 			);
// 		});

// 		test('should throws exception if message has not own property sender_id', function() {
// 			var validator = require('./../validator');

// 			var message = {
// 				target_id: 1,
// 				body: 'Hello World'
// 			};

// 			assert.throws(
// 				function() {
// 					validator.message(message);
// 				},
// 				function (error) {
// 					return error instanceof Error && /Message has not property sender_id/.test(error);
// 				}
// 			);
// 		});

// 		test('should throws exception if message has not own property body', function() {
// 			var validator = require('./../validator');

// 			var message = {
// 				target_id: 1,
// 				sender_id: 2
// 			};

// 			assert.throws(
// 				function() {
// 					validator.message(message);
// 				},
// 				function(error) {
// 					return error instanceof Error && /Message has not property body/.test(error);
// 				}
// 			);
// 		});

// 		test('should validate if message has all properties', function() {
// 			var validator = require('./../validator');

// 			var message = {
// 				target_id: 1,
// 				sender_id: 2,
// 				body: 'Hello World!'
// 			};

// 			assert.doesNotThrow(
// 				function() {
// 					validator.message(message);
// 				},
// 				'Message is invalid'
// 			);
// 		});
// 	});
// });
{'fraction_non_alphanumeric': 0.17986746607762702, 'fraction_numerical': 0.0025244556642473968, 'mean_word_length': 2.136566056407719, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '627109', 'n_tokens_mistral': 2559, 'n_tokens_neox': 2095, 'n_words': 503}