public void Registration() { Authentificator auth = new Authentificator("test_name", "test_password"); User user = auth.Register(); Assert.IsTrue(user.IsLoggedIn); }
public async Task <IReadOnlyList <string> > GetStories(string userName) { const string stateFile = "state.bin"; var IOService = new StubInputOutputService(); var authentificator = new Authentificator(); var(_, instaApi) = await authentificator.AuthentificateByDefaultWay(stateFile, IOService); var apiKeeper = new ApiKeeper(instaApi); var userService = new UserService(apiKeeper.InstaApi); var userInfo = await userService.GetUserInfo(userName); var mediaService = new StoryService(apiKeeper.InstaApi); var stories = await mediaService.GetUserStories(userInfo); return(stories.SelectMany(st => st.Images.Select(img => img.Uri).Distinct().Concat( st.Videos.Select(vd => vd.Uri).Distinct() )).ToArray()); }