public void Scrobble_NotPlayedForLongEnough_ThrowsException()
 {
     // Arrange
     var scrobbler = new ScrobblerUnderTest("test", "test");
     
     // Act
     scrobbler.Scrobble(new Track {Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds*2), WhenStartedPlaying = DateTime.Now});
 }
 public void Scrobble_DurationTooShort_ThrowsException()
 {
     // Arrange
     var scrobbler = new ScrobblerUnderTest("test", "test");
     
     // Act
     scrobbler.Scrobble(new Track {Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds/2), WhenStartedPlaying = DateTime.Now.AddMinutes(-4)});
 }
Ejemplo n.º 3
0
        public void Scrobble_NotPlayedForLongEnough_ThrowsException()
        {
            // Arrange
            var scrobbler = new ScrobblerUnderTest("test", "test");

            // Act
            scrobbler.Scrobble(new Track {
                Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds * 2), WhenStartedPlaying = DateTime.Now
            });
        }
Ejemplo n.º 4
0
        public void Scrobble_DurationTooShort_ThrowsException()
        {
            // Arrange
            var scrobbler = new ScrobblerUnderTest("test", "test");

            // Act
            scrobbler.Scrobble(new Track {
                Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds / 2), WhenStartedPlaying = DateTime.Now.AddMinutes(-4)
            });
        }
Ejemplo n.º 5
0
        public void Scrobble_TrackDurationAndWhenStartedOk_CallsApiScrobble()
        {
            // Arrange
            var scrobbler = new ScrobblerUnderTest("test", "test");

            // Act
            scrobbler.Scrobble(new Track {
                Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds * 2), WhenStartedPlaying = DateTime.Now.AddMinutes(-4)
            });

            // Assert
            scrobbler.TrackApiMock.Verify(a => a.Scrobble(It.IsAny <Track>(), It.IsAny <Authentication>()));
        }
        public void Scrobble_TrackDurationAndWhenStartedOk_CallsApiScrobble()
        {
            // Arrange
            var scrobbler = new ScrobblerUnderTest("test", "test");
            
            // Act
            scrobbler.Scrobble(new Track {Duration = new TimeSpan(Scrobbler.MinimumScrobbleTrackLengthInSeconds*2), WhenStartedPlaying = DateTime.Now.AddMinutes(-4)});

            // Assert
            scrobbler.TrackApiMock.Verify(a=>a.Scrobble(It.IsAny<Track>(), It.IsAny<Authentication>()));
        }