Skip to content

Commit

Permalink
Updated unit tests for recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
orchetect committed Nov 23, 2023
1 parent 20f2c67 commit 8888449
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import XCTest
@testable import MarkersExtractor
import DAWFileKit
import TimecodeKit

final class BasicMarkersOutOfClipBoundsTests: XCTestCase {
Expand All @@ -25,22 +26,26 @@ final class BasicMarkersOutOfClipBoundsTests: XCTestCase {
let fr: TimecodeFrameRate = .fps25

let clip1ParentInfo = Marker.ParentInfo(
clipType: FinalCutPro.FCPXML.ClipType.assetClip.name,
clipName: "Marker Test",
clipFilename: "Marker Test.m4v",
clipInTime: tc("00:00:00:00", at: fr),
clipOutTime: tc("00:00:20:20", at: fr),
eventName: "Test Event",
projectName: "Out of Bounds Markers",
projectStartTime: tc("00:00:00:00", at: fr),
libraryName: "MyLibrary"
)

let clip2ParentInfo = Marker.ParentInfo(
clipType: FinalCutPro.FCPXML.ClipType.assetClip.name,
clipName: "Marker Test",
clipFilename: "Marker Test.m4v",
clipInTime: tc("00:00:20:20", at: fr),
clipOutTime: tc("00:00:41:15", at: fr),
eventName: "Test Event",
projectName: "Out of Bounds Markers",
projectStartTime: tc("00:00:00:00", at: fr),
libraryName: "MyLibrary"
)

Expand Down
3 changes: 3 additions & 0 deletions Tests/MarkersExtractorTests/BasicMarkersTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import XCTest
@testable import MarkersExtractor
import DAWFileKit
import TimecodeKit

final class BasicMarkersTests: XCTestCase {
Expand All @@ -31,12 +32,14 @@ final class BasicMarkersTests: XCTestCase {
let fr: TimecodeFrameRate = .fps29_97

let parentInfo = Marker.ParentInfo(
clipType: FinalCutPro.FCPXML.ClipType.title.name,
clipName: "Basic Title",
clipFilename: "",
clipInTime: tc("00:00:00:00", at: fr),
clipOutTime: tc("00:01:03:29", at: fr),
eventName: "Test Event",
projectName: "Test Project",
projectStartTime: tc("00:00:00:00", at: fr),
libraryName: "MyLibrary"
)

Expand Down
7 changes: 6 additions & 1 deletion Tests/MarkersExtractorTests/MarkersExtractorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import XCTest
@testable import MarkersExtractor
import DAWFileKit
import TimecodeKit

final class MarkersExtractorTests: XCTestCase {
Expand All @@ -26,12 +27,14 @@ final class MarkersExtractorTests: XCTestCase {
roles: .init(video: "Video", audio: ""),
position: tc(position, at: .fps24),
parentInfo: .init(
clipType: FinalCutPro.FCPXML.ClipType.video.name,
clipName: "Some Clip",
clipFilename: "",
clipInTime: tc("00:00:00:00", at: .fps24),
clipOutTime: tc("01:00:00:00", at: .fps24),
eventName: "Some Event",
projectName: "MyProject",
projectName: "MyProject",
projectStartTime: tc("01:00:00:00", at: .fps24),
libraryName: "MyLibrary"
)
)
Expand Down Expand Up @@ -80,12 +83,14 @@ final class MarkersExtractorTests: XCTestCase {
roles: .init(video: "Video", audio: ""),
position: tc(position, at: .fps24),
parentInfo: .init(
clipType: FinalCutPro.FCPXML.ClipType.video.name,
clipName: "Some Clip",
clipFilename: "",
clipInTime: tc("00:00:00:00", at: .fps24),
clipOutTime: tc("01:00:00:00", at: .fps24),
eventName: "Some Event",
projectName: "MyProject",
projectStartTime: tc("01:00:00:00", at: .fps24),
libraryName: "MyLibrary"
)
)
Expand Down
14 changes: 12 additions & 2 deletions Tests/MarkersExtractorTests/ProgressTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ final class ProgressTests: XCTestCase {
let videoPlaceholder = try TemporaryMediaFile(withData: videoData)
let range = tc("00:00:00:00", at: .fps24) ... tc("00:00:00:10", at: .fps24)
let descriptors: [ImageDescriptor] = range.map {
ImageDescriptor(timecode: $0, filename: UUID().uuidString, label: nil)
ImageDescriptor(
absoluteTimecode: $0,
offsetFromVideoStart: $0,
filename: UUID().uuidString,
label: nil
)
}
let outputFolder = FileManager.default.temporaryDirectory
let outputFile = outputFolder.appendingPathComponent(UUID().uuidString + ".gif")
Expand Down Expand Up @@ -76,7 +81,12 @@ final class ProgressTests: XCTestCase {
let videoPlaceholder = try TemporaryMediaFile(withData: videoData)
let range = tc("00:00:00:00", at: .fps24) ... tc("00:00:00:10", at: .fps24)
let descriptors: [ImageDescriptor] = range.map {
ImageDescriptor(timecode: $0, filename: UUID().uuidString, label: nil)
ImageDescriptor(
absoluteTimecode: $0,
offsetFromVideoStart: $0,
filename: UUID().uuidString,
label: nil
)
}
let outputFolder = FileManager.default.temporaryDirectory

Expand Down

0 comments on commit 8888449

Please sign in to comment.