public void GetAppFromRepositoryTest() //тест app репозитория с помощью мок сервера { IAppRepository appRepository = new AppRepositoryVk(); appRepository.URL = "http://localhost:8080/method/"; AppVk app = appRepository.GetAppById("4063926"); Assert.AreEqual("4063926", app.id); Assert.AreEqual("Головоломка", app.genre); Assert.AreEqual(1853250, app.members_count); }
public void GetAppByAndPopularAppId() { IAppRepository appRepository = new AppRepositoryVk(); appRepository.URL = "https://api.vk.com/method/"; AppService appService = new AppService(appRepository); string popular = appService.GetPopularAppVk("4063926"); Assert.AreEqual("Очень популярно", popular); popular = appService.GetPopularAppVk("5297630"); Assert.AreEqual("Непопулярно", popular); popular = appService.GetPopularAppVk("4207803"); Assert.AreEqual("Популярно", popular); }