public void GetContentPath_should_parse_protocol_relative_url()
        {
            // Given
            const string videoPath = "example.com/testVideo.mp4";

            // When
            var parsedPath = ContentUrlHelper.GetContentPath(config, videoPath);

            // Then
            parsedPath.Should().Be($"https://{videoPath}");
        }
        public void GetContentPath_should_parse_relative_path()
        {
            // Given
            const string videoPath = "/testVideo.mp4";

            // When
            var parsedPath = ContentUrlHelper.GetContentPath(config, videoPath);

            // Then
            parsedPath.Should().Be(BaseUrl + videoPath);
        }
        public void GetContentPath_should_parse_absolute_url()
        {
            // Given
            const string videoPath = "https://example.com/testVideo.mp4";

            // When
            var parsedPath = ContentUrlHelper.GetContentPath(config, videoPath);

            // Then
            parsedPath.Should().Be(videoPath);
        }
Пример #4
0
 public TutorialVideoViewModel(
     IConfiguration config,
     TutorialVideo tutorialVideo,
     int customisationId,
     int sectionId,
     int tutorialId
     )
 {
     CustomisationId = customisationId;
     SectionId       = sectionId;
     TutorialId      = tutorialId;
     TutorialName    = tutorialVideo.TutorialName;
     SectionName     = tutorialVideo.SectionName;
     CourseTitle     = tutorialVideo.CourseTitle;
     VideoPath       = ContentUrlHelper.GetContentPath(config, tutorialVideo.VideoPath);
 }