public ActionResult Activity()
 {
     // Request access to user profile
     var tokenManager = new AccessTokenManager("068e4fe819724d1b94a8889b6a23edbf", "152865a51b9f4b2d80248c5341de6dd5", "http://www.jmckillip.com", "b9be0fab840e458389349bee9ccb6c0a");
     var userRequest = new UsersEndpoint(tokenManager);
     var user = userRequest.GetUser();
     // Get user profile 
     var profileRequest = new ProfileEndpoint(tokenManager, user);
     var profile = profileRequest.GetProfile();
     // Get user name to pass to Activity view via ViewData Dictionary
     ViewData["name"] = profile.Name;
     //Retrieve activities
     var activitiesRequest = new FitnessActivitiesEndpoint(tokenManager, user);
     // Since the feed shows latest first, I only want to get that last one
     var activitiesPage = activitiesRequest.GetFeedPage(null, 1);
     // items[0].Uri will return the URI of the latest activity.
     var items = activitiesPage.Items;
     // Get the latest activity
     var latestActivity = activitiesRequest.GetActivity(items[0].Uri);
     return View(latestActivity);
 }
 public void GetActivity_UriValid_DoesNotThrowArgumentException()
 {
     //Arrange
     var validPath = "/test/";
     Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>();
     FitnessActivitiesEndpoint activitiesRequest = new FitnessActivitiesEndpoint(tokenManager.Object, new UsersModel { FitnessActivities = validPath });
     //Act and Assert
     Assert.DoesNotThrow(() => { activitiesRequest.GetActivity(validPath); });
 }
 public void GetActivity_UriNotValid_ArgumentException()
 {
     //Arrange
     var validPath = "/test/";
     Mock<AccessTokenManagerBaseStub> tokenManager = new Mock<AccessTokenManagerBaseStub>();
     FitnessActivitiesEndpoint activitiesRequest = new FitnessActivitiesEndpoint(tokenManager.Object, new UsersModel { FitnessActivities = validPath });
     //Act and Assert
     Assert.Throws(typeof(ArgumentException), () => { activitiesRequest.GetActivity("Not validPath."); });
 }