Exemple #1
0
        public void ShouldSetDurationToZeroIfThereIsNotTrackInProject()
        {
            Project project = new Project();

            project.AddTimeline(new Sequence());
            project.SetProjectDuration();

            Assert.IsTrue(project.Duration == 0);
        }
Exemple #2
0
        public void ShouldSetDurationToZeroIfThereIsNoElementsInTracks()
        {
            Project project = new Project();

            project.AddTimeline(new Sequence());
            Track track1 = new Track();
            Track track2 = new Track();

            project.Timelines[0].Tracks.Add(track1);
            project.Timelines[0].Tracks.Add(track2);

            project.SetProjectDuration();

            Assert.IsTrue(project.Duration == 0);
        }
Exemple #3
0
        public void ShouldSetTheProjectDurationWhenThereIsOneTrackAndOneShot()
        {
            Project project = new Project();

            project.AddTimeline(new Sequence());
            Track track = new Track();

            project.Timelines[0].Tracks.Add(track);
            TimelineElement timelineElement = new TimelineElement()
            {
                InPosition  = TimeCode.FromSeconds(2000.0, SmpteFrameRate.Smpte25),
                OutPosition = TimeCode.FromSeconds(3000.0, SmpteFrameRate.Smpte25),
                Position    = TimeCode.FromSeconds(10000.0, SmpteFrameRate.Smpte25)
            };

            track.Shots.Add(timelineElement);
            project.SetProjectDuration();
            var duration = timelineElement.OutPosition.TotalSeconds - timelineElement.InPosition.TotalSeconds +
                           timelineElement.Position.TotalSeconds;

            Assert.AreEqual(project.Duration, duration);
        }