//----------------------------------------User Validation //test protected async Task <bool> fetchUserInfo() { UserInfoFetcher startFetcher = new UserInfoFetcher(_startUser.Nick); _startUser = await startFetcher.fetchInfo(); if (startFetcher.Status != FetchResult.Success) { updateError(startFetcher.Status); textBoxBadData(startTextBox); return(false); } UserInfoFetcher targetFetcher = new UserInfoFetcher(_targetUser.Nick); _targetUser = await targetFetcher.fetchInfo(); if (targetFetcher.Status != FetchResult.Success) { updateError(targetFetcher.Status); textBoxBadData(targetTextBox); return(false); } return(true); }
public async Task fetchInfoTest() { UserInfoFetcher fetcher = new UserInfoFetcher("deell1"); VKUserViewData expected = new VKUserViewData(198489790, "Дильмурад", "deell1", "http://cs629511.vk.me/v629511790/2c646/KZsDKpWrvVQ.jpg"); VKUserViewData result = await fetcher.fetchInfo(); Assert.AreEqual(expected.ID, result.ID, "Method fetchInfo() don`t fetch information correctly"); Assert.AreEqual(expected.Name, result.Name, "Method fetchInfo() don`t fetch information correctly"); Assert.AreEqual(expected.Nick, result.Nick, "Method fetchInfo() don`t fetch information correctly"); Assert.AreEqual(expected.PhotoUrl, result.PhotoUrl, "Method fetchInfo() don`t fetch information correctly"); }
private async Task <List <VKUserViewData> > getUserDataForPath() { List <VKUserViewData> list = new List <VKUserViewData>(); foreach (VKUser user in _path) { UserInfoFetcher fetcher = new UserInfoFetcher(user.ID.ToString()); VKUserViewData userInfo = await fetcher.fetchInfo(); if (fetcher.Status != FetchResult.Success) { break; } list.Add(userInfo); } return(list); }
//----------------------------------------User Validation //test protected async Task<bool> fetchUserInfo() { UserInfoFetcher startFetcher = new UserInfoFetcher(_startUser.Nick); _startUser = await startFetcher.fetchInfo(); if (startFetcher.Status != FetchResult.Success) { updateError(startFetcher.Status); textBoxBadData(startTextBox); return false; } UserInfoFetcher targetFetcher = new UserInfoFetcher(_targetUser.Nick); _targetUser = await targetFetcher.fetchInfo(); if (targetFetcher.Status != FetchResult.Success) { updateError(targetFetcher.Status); textBoxBadData(targetTextBox); return false; } return true; }
public async Task fetchInfoNullTest2() { UserInfoFetcher fetcher = new UserInfoFetcher("deell2"); VKUserViewData result = await fetcher.fetchInfo(); Assert.AreEqual(null, result, "Method fetchInfo() don`t fetch information correctly"); }
private async Task<List<VKUserViewData>> getUserDataForPath() { List<VKUserViewData> list = new List<VKUserViewData>(); foreach (VKUser user in _path) { UserInfoFetcher fetcher = new UserInfoFetcher(user.ID.ToString()); VKUserViewData userInfo = await fetcher.fetchInfo(); if (fetcher.Status != FetchResult.Success) { break; } list.Add(userInfo); } return list; }