public void SearchForFiles_WithTags_AllMatch() { var tagRepository = new TagRepository(); var tagDto = new CreateVideoTagDto("test 1", ""); var tag1Id = tagRepository.CreateVideoTag(tagDto); var tag1 = tagRepository.GetVideoTag(tag1Id); tagDto = new CreateVideoTagDto("test 2", ""); var tag2Id = tagRepository.CreateVideoTag(tagDto); var tag2 = tagRepository.GetVideoTag(tag2Id); var fileId = repository.CreateMediaFile(new CreateMediaFileDto("", MediaFileType.VIDEO_TYPE, "")); var file = repository.GetMediaFile(fileId); repository.AddTagToMediaFile(file, tag1); repository.AddTagToMediaFile(file, tag2); var queries = new List <IMediaFileSearchQueryGenerator>(); queries.Add(new MediaFileWithTagsGenerator("[\"test 1\", \"test 2\"]")); var actualFiles = repository.SearchForFiles(GetFirstPage(), queries).Result.Results; var expectedFiles = new List <MediaFile> { file }; CollectionAssert.AreEquivalent(expectedFiles, actualFiles); }
public VideoTag CreateAndRetrieveVideoTag(CreateVideoTagDto dto) { long tagId = CreateVideoTag(dto); return(new VideoTag(tagId, dto)); }
public long CreateVideoTag(CreateVideoTagDto dto) { return(tagRepository.CreateVideoTag(dto)); }
public VideoTag(long tagId, CreateVideoTagDto dto) : base(tagId, dto) { }
public long CreateVideoTag(CreateVideoTagDto videoTag) { return(CreateTag(videoTag, "video_tag")); }