// handle unit tests for the "POST /codemarks" request to create a knowledge base codemark

'use strict';

const PostCodemarkTest = require('./post_codemark_test');
const MarkerTest = require('./marker_test');
const NoAttributeTest = require('./no_attribute_test');
const NoCommitHashTest = require('./no_commit_hash_test');
const NoCommitHashWithFileTest = require('./no_commit_hash_with_file_test');
const NoCommitHashWithStreamTest = require('./no_commit_hash_with_stream_test');
const NoCommitHashWithStreamIdTest = require('./no_commit_hash_with_stream_id_test');
const MarkersNotArrayTest = require('./markers_not_array_test');
const MarkersTooLongTest = require('./markers_too_long_test');
const MarkerNotObjectTest = require('./marker_not_object_test');
const MarkerAttributeRequiredTest = require('./marker_attribute_required_test');
const LocationTooLongTest = require('./location_too_long_test');
const LocationTooShortTest = require('./location_too_short_test');
const LocationMustBeNumbersTest = require('./location_must_be_numbers_test');
const InvalidCoordinateObjectTest = require('./invalid_coordinate_object_test');
const NoLocationOkTest = require('./no_location_ok_test');
const TooManyRemotesTest = require('./too_many_remotes_test');
const TooManyKnownCommitHashesTest = require('./too_many_known_commit_hashes_test');
const MarkerHasInvalidStreamIdTest = require('./marker_has_invalid_stream_id_test');
const MarkerHasUnknownStreamIdTest = require('./marker_has_unknown_stream_id_test');
const MarkerHasInvalidRepoIdTest = require('./marker_has_invalid_repo_id_test');
const MarkerHasUnknownRepoIdTest = require('./marker_has_unknown_repo_id_test');
const MarkerForBadStreamTypeTest = require('./marker_for_bad_stream_type_test');
const MarkerFromDifferentTeamTest = require('./marker_from_different_team_test');
const MarkerStreamOnTheFly = require('./marker_stream_on_the_fly_test');
const FindRepoByRemotesTest = require('./find_repo_by_remotes_test');
const FindRepoByKnownCommitHashesTest = require('./find_repo_by_known_commit_hashes_test');
const FindRepoByCommitHashTest = require('./find_repo_by_commit_hash_test');
const UpdateMatchedRepoWithRemotesTest = require('./update_matched_repo_with_remotes_test');
const UpdateSetRepoWithRemotesTest = require('./update_set_repo_with_remotes_test');
const CreateRepoOnTheFlyTest = require('./create_repo_on_the_fly_test');
const CreateRepoOnTheFlyWithCommitHashesTest = require('./create_repo_on_the_fly_with_commit_hashes_test');
const DuplicateFileStreamTest = require('./duplicate_file_stream_test');
const MessageToTeamTest = require('./message_to_team_test');
const UpdatedSetRepoMessageTest = require('./updated_set_repo_message_test');
const UpdatedKnownCommitHashesForRepoMessageTest = require('./updated_known_commit_hashes_for_repo_test');
const OnTheFlyMarkerStreamFromDifferentTeamTest = require('./on_the_fly_marker_stream_from_different_team_test');
const OnTheFlyMarkerStreamRepoNotFoundTest = require('./on_the_fly_marker_stream_repo_not_found_test');
const OnTheFlyMarkerStreamNoRemotesTest = require('./on_the_fly_marker_stream_no_remotes_test');
const OnTheFlyMarkerStreamInvalidRepoIdTest = require('./on_the_fly_marker_stream_invalid_repo_id_test');
const ACLTeamTest = require('./acl_team_test');
const TeamNotFoundTest = require('./team_not_found_test');
const EmptyPostIdTest = require('./empty_post_id_test');
const InvalidTypeTest = require('./invalid_type_test');
const ValidTypeTest = require('./valid_type_test');
const ValidTypeWithMarkerTest = require('./valid_type_with_marker_test');
const MarkerRequiredTest = require('./marker_required_test');
const RequiredForTypeTest = require('./required_for_type_test');
const RequiredForTypeWithMarkerTest = require('./required_for_type_with_marker_test');
const InvisibleTypeTest = require('./invisible_type_test');
const IssueWithAssigneesTest = require('./issue_with_assignees_test');
const AssigneesIgnoredTest = require('./assignees_ignored_test');
const ParentPostIdTest = require('./parent_post_id_test');
const OriginFromPluginTest = require('./origin_from_plugin_test');
const OriginDetailFromPluginTest = require('./origin_detail_from_plugin_test');
const ExternalIssueProviderTest = require('./external_issue_provider_test');
const NoProviderTypeWithLinkTest = require('./no_provider_type_with_link_test');
const PermalinkTest = require('./permalink_test');
const DuplicateLinkTest = require('./duplicate_link_test');
const RelatedCodemarksTest = require('./related_codemarks_test');
const RelatedCodemarkNotFoundTest = require('./related_codemark_not_found_test');
const RelatedCodemarkACLTest = require('./related_codemark_acl_test');
const RelatedCodemarksDifferentTeamTest = require('./related_codemarks_different_team_test');
const TagsTest = require('./tags_test');
const TagNotFoundTest = require('./tag_not_found_test');
const DeactivatedTagTest = require('./deactivated_tag_test');
const DeactivatedDefaultTagTest = require('./deactivated_default_tag_test');
const ColorBecomesTagTest = require('./color_becomes_tag_test');
const NoDuplicateNonLinkTest = require('./no_duplicate_non_link_test');
const ReferenceLocationsTest = require('./reference_locations_test');
const NoCommitHashInReferenceLocation = require('./no_commit_hash_in_reference_location_test');
const InvalidCommitHashInReferenceLocation = require('./invalid_commit_hash_in_reference_location_test');
const EmptyCommitHashInReferenceLocation = require('./empty_commit_hash_in_reference_location_test');
const NoLocationInReferenceLocationTest = require('./no_location_in_reference_location_test');
const InvalidLocationInReferenceLocationTest = require('./invalid_location_in_reference_location_test');
const MultipleMarkersTest = require('./multiple_markers_test');
const MultipleMarkersStreamOnTheFlyTest = require('./multiple_markers_stream_on_the_fly_test');
const AddFollowersTest = require('./add_followers_test');
const AddCreatorAsFollowerTest = require('./add_creator_as_follower_test');
const InvalidFollowerTest = require('./invalid_follower_test');
const FollowerNotOnTeamTest = require('./follower_not_on_team_test');

class PostCodemarkRequestTester {

	test () {
		new PostCodemarkTest().test();
		new MarkerTest().test();
		new NoAttributeTest({ attribute: 'type' }).test();
		new NoAttributeTest({ attribute: 'teamId' }).test();
		//new NoAttributeTest({ attribute: 'providerType' }).test();
		new NoAttributeTest({ attribute: 'streamId' }).test();
		new NoCommitHashTest().test();
		new NoCommitHashWithFileTest().test();
		new NoCommitHashWithStreamTest().test();
		new NoCommitHashWithStreamIdTest().test();
		new MarkersNotArrayTest().test();
		new MarkersTooLongTest().test();
		new MarkerNotObjectTest().test();
		new MarkerAttributeRequiredTest({ attribute: 'code' }).test();
		new LocationTooLongTest().test();
		new LocationTooShortTest().test();
		new LocationMustBeNumbersTest().test();
		new InvalidCoordinateObjectTest().test();
		new NoLocationOkTest().test();
		new TooManyRemotesTest().test();
		new TooManyKnownCommitHashesTest().test();
		new MarkerHasInvalidStreamIdTest().test();
		new MarkerHasUnknownStreamIdTest().test();
		new MarkerHasInvalidRepoIdTest().test();
		new MarkerHasUnknownRepoIdTest().test();
		//new MarkerForBadStreamTypeTest({ streamType: 'direct' }).test();
		//new MarkerForBadStreamTypeTest({ streamType: 'channel' }).test();
		new MarkerFromDifferentTeamTest().test();
		new MarkerStreamOnTheFly({ streamType: 'direct' }).test();
		new MarkerStreamOnTheFly({ streamType: 'channel' }).test();
		new FindRepoByRemotesTest().test();
		new FindRepoByKnownCommitHashesTest().test();
		new FindRepoByCommitHashTest().test();
		new UpdateMatchedRepoWithRemotesTest().test();
		new UpdateSetRepoWithRemotesTest().test();
		new CreateRepoOnTheFlyTest().test();
		new CreateRepoOnTheFlyWithCommitHashesTest().test();
		new DuplicateFileStreamTest().test();
		new MessageToTeamTest().test();
		new UpdatedSetRepoMessageTest().test();
		new UpdatedKnownCommitHashesForRepoMessageTest().test();
		new OnTheFlyMarkerStreamFromDifferentTeamTest().test();
		new OnTheFlyMarkerStreamRepoNotFoundTest().test();
		new OnTheFlyMarkerStreamNoRemotesTest().test();
		new OnTheFlyMarkerStreamInvalidRepoIdTest().test();
		new ACLTeamTest().test();
		new TeamNotFoundTest().test();
		new EmptyPostIdTest().test();
		new InvalidTypeTest().test();
		new ValidTypeTest({ codemarkType: 'issue' }).test();
		new ValidTypeTest({ codemarkType: 'question' }).test();
		new ValidTypeWithMarkerTest({ codemarkType: 'bookmark' }).test();
		new ValidTypeWithMarkerTest({ codemarkType: 'trap' }).test();
		new ValidTypeWithMarkerTest({ codemarkType: 'link' }).test();
		new MarkerRequiredTest({ codemarkType: 'bookmark' }).test();
		new MarkerRequiredTest({ codemarkType: 'trap' }).test();
		new MarkerRequiredTest({ codemarkType: 'link' }).test();
		new RequiredForTypeTest({ codemarkType: 'comment', attribute: 'text' }).test();
		new RequiredForTypeTest({ codemarkType: 'question', attribute: 'title' }).test();
		new RequiredForTypeTest({ codemarkType: 'issue', attribute: 'title' }).test();
		new RequiredForTypeWithMarkerTest({ codemarkType: 'bookmark', attribute: 'title' }).test();
		new RequiredForTypeWithMarkerTest({ codemarkType: 'trap', attribute: 'text' }).test();
		new InvisibleTypeTest({ codemarkType: 'link', attribute: 'text' }).test();
		new InvisibleTypeTest({ codemarkType: 'link', attribute: 'title' }).test();
		new IssueWithAssigneesTest().test();
		new AssigneesIgnoredTest().test();
		new ParentPostIdTest().test();
		new OriginFromPluginTest().test();
		new OriginDetailFromPluginTest().test();
		new ExternalIssueProviderTest().test();
		new NoProviderTypeWithLinkTest().test();
		new PermalinkTest({ permalinkType: 'public' }).test();
		new PermalinkTest({ permalinkType: 'private' }).test();
		new DuplicateLinkTest({ permalinkType: 'public' }).test();
		new DuplicateLinkTest({ permalinkType: 'private' }).test();
		new RelatedCodemarksTest().test();
		new RelatedCodemarkNotFoundTest().test();
		new RelatedCodemarkACLTest().test();
		new RelatedCodemarksDifferentTeamTest().test();
		new TagsTest().test();
		new TagNotFoundTest().test();
		new DeactivatedTagTest().test();
		new DeactivatedDefaultTagTest().test();
		new ColorBecomesTagTest().test();
		new NoDuplicateNonLinkTest().test();
		new ReferenceLocationsTest().test();
		new NoCommitHashInReferenceLocation().test();
		new InvalidCommitHashInReferenceLocation().test();
		new EmptyCommitHashInReferenceLocation().test();
		new NoLocationInReferenceLocationTest().test();
		new InvalidLocationInReferenceLocationTest().test();
		new MultipleMarkersTest().test();
		new MultipleMarkersStreamOnTheFlyTest().test();
		new AddFollowersTest().test();
		new AddCreatorAsFollowerTest().test();
		new InvalidFollowerTest().test();
		new FollowerNotOnTeamTest().test();
	}
}

module.exports = new PostCodemarkRequestTester();
