Ejemplo n.º 1
0
        public void SaveChanges()
        {
            Validate(LiveThread);

            // Make some changes.  --Kris
            LiveThread.NSFW = true;
            string updatedResourcesText = "Updated resources text.";

            LiveThread.Resources = updatedResourcesText;

            // Save the changes (makes a call to the Edit model).  --Kris
            LiveThread.SaveChanges();

            // Update the live thread instance to match what the API has (should be the same after SaveChanges was called).  --Kris
            LiveThread = LiveThread.About();

            // If SaveChanges failed for whatever reason, the values will not match.  --Kris
            Validate(LiveThread);
            Assert.AreEqual(true, LiveThread.NSFW);
            Assert.AreEqual(updatedResourcesText, LiveThread.Resources);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a copy of an existing live thread controller instance.
 /// </summary>
 /// <param name="liveThread">A valid live thread controller instance</param>
 /// <returns>A new live thread controller instance.</returns>
 public LiveThread LiveThread(LiveThread liveThread)
 {
     return(new LiveThread(Models, liveThread));
 }
Ejemplo n.º 3
0
 private LiveThread CreateThread()
 {
     LiveThread = reddit.LiveThread("Test Thread", "This is a test live thread created by Reddit.NET.").Create(nsfw: false, resources: "Resources text.");
     return(LiveThread);
 }