예제 #1
0
        public async Task ShouldCellphoneLoginSuccess()
        {
            var api  = new MusicApi();
            var user = await api.LoginAsync(Configuration.Username, Configuration.Password);

            Assert.AreEqual(user.Name, Configuration.Nickname);
        }
예제 #2
0
 public static async Task <User> EnsureLogined()
 {
     if (Api.Me == null)
     {
         await Api.LoginAsync(Configuration.Username, Configuration.Password);
     }
     return(Api.Me);
 }
예제 #3
0
        public async Task ShouldCookiePersist()
        {
            var storage = new Storage();
            var api     = new MusicApi(storage);
            var user    = api.Me ?? await api.LoginAsync(Configuration.Username, Configuration.Password);

            api.Dispose();
            api = new MusicApi(storage);
            Assert.IsNotNull(api.Me);
            await api.RecommendAsync <Song>();
        }