예제 #1
0
 public void TestInitialise()
 {
     _mockAuth = new Mock <ILastAuth>();
     _command  = new GetWeeklyAlbumChartCommand(_mockAuth.Object, user)
     {
         From = 1234,
         To   = 5678
     };
     _command.SetParameters();
 }
예제 #2
0
        public async Task <PageResponse <LastAlbum> > GetWeeklyAlbumChartAsync(string username, double?from = null, double?to = null)
        {
            var command = new GetWeeklyAlbumChartCommand(auth: Auth, username: username)
            {
                From       = from,
                To         = to,
                HttpClient = HttpClient
            };

            return(await command.ExecuteAsync());
        }
예제 #3
0
        public void CorrectParametersNoToFrom()
        {
            var expected = new Dictionary <string, string>
            {
                { "user", user },
                { "disablecachetoken", "" }
            };

            GetWeeklyAlbumChartCommand _command2 = new GetWeeklyAlbumChartCommand(_mockAuth.Object, user)
            {
                //no parameters
            };

            _command2.SetParameters();
            _command2.Parameters["disablecachetoken"] = "";

            TestHelper.AssertSerialiseEqual(expected, _command2.Parameters);
        }