public async Task <IActionResult> GetTrainData([FromBody] TwitterProfileApi apiprofile) { if (apiprofile == null) { return(BadRequest()); } if (apiprofile.Name == null) { return(BadRequest()); } var profile = _repository.Get(apiprofile); if (profile == null) { return(NotFound()); } try { var tweets = await _twitterService.GetAllTweetsFromProfile(profile); if (tweets == null) { return(BadRequest()); } return(Ok(tweets)); } catch (Exception e) { return(BadRequest(e)); } }
public void TestGetList() { Assert.DoesNotThrow(() => Task.Run(() => _service.GetAllTweetsFromProfile(new TwitterProfile("UBoat2018")))); }