public void TestCopyFrom() { var originalCollection = new TrackCollection { _testTrack }; var copiedCollection = TrackCollection.CopyFrom(originalCollection); Assert.AreNotSame(originalCollection, copiedCollection); var originalFirstTrack = originalCollection[0]; var copiedFirstTrack = copiedCollection[0]; Assert.AreNotSame(originalFirstTrack, copiedFirstTrack); Assert.AreNotSame(originalFirstTrack.Beats, copiedFirstTrack.Beats); Assert.AreNotSame(originalFirstTrack.FadeIns, copiedFirstTrack.FadeIns); Assert.AreNotSame(originalFirstTrack.FadeOuts, copiedFirstTrack.FadeOuts); Assert.AreEqual(originalFirstTrack.Duration, copiedFirstTrack.Duration); Assert.AreEqual(originalFirstTrack.Bpm, copiedFirstTrack.Bpm); Assert.AreEqual(originalFirstTrack.Key, copiedFirstTrack.Key); Assert.AreEqual(originalFirstTrack.Samplerate, copiedFirstTrack.Samplerate); Assert.AreEqual(originalFirstTrack.Danceability, copiedFirstTrack.Danceability); for (var i = 0; i < 3; i++) { Assert.AreEqual(originalFirstTrack.Beats[i], copiedFirstTrack.Beats[i]); Assert.AreEqual(originalFirstTrack.FadeIns[i], copiedFirstTrack.FadeIns[i]); Assert.AreEqual(originalFirstTrack.FadeOuts[i], copiedFirstTrack.FadeOuts[i]); } }
private void RetrieveControlOnCollection() { _trackCollection = TrackCollection.CopyFrom(_trackCollection); }