Beispiel #1
0
        /// <summary>
        /// Adds all original links to a <see cref="RedditUserProfileSqlite"/>
        /// </summary>
        /// <param name="r">A <see cref="Reddit"/> used for getting user information, cheifly the name of a user</param>
        public void AddToProfile(Reddit r)
        {
            var profile = new RedditUserProfileSqlite(r.GetUser(Name));

            foreach (var a in ArchiveLinks)
            {
                profile.AddUrlUsed(a.OriginalLink);
            }
        }
        public void TestAddUrlUsed()
        {
            new RedditUserProfileSqlite("6\\redditusers.sqlite");
            RedditUserProfileSqlite redditUserProfileSqlite = new RedditUserProfileSqlite(red.GetUser("chugga_fan"));

            redditUserProfileSqlite.AddUrlUsed("http://archive.fo");
            Assert.IsTrue(redditUserProfileSqlite.Archived == 1);
            redditUserProfileSqlite.AddUrlUsed("http://youtu.be");
            Assert.IsTrue(redditUserProfileSqlite.Excluded == 1);
            redditUserProfileSqlite.AddUrlUsed("help.gif");
            Assert.IsTrue(redditUserProfileSqlite.Image == 1);
            redditUserProfileSqlite.OptedOut = true;
            // TEST OPT OUT WORKS
            redditUserProfileSqlite.AddUrlUsed("http://archive.fo");
            Assert.IsTrue(redditUserProfileSqlite.Archived == 1);
            redditUserProfileSqlite.AddUrlUsed("http://youtu.be");
            Assert.IsTrue(redditUserProfileSqlite.Excluded == 1);
            redditUserProfileSqlite.AddUrlUsed("help.gif");
            Assert.IsTrue(redditUserProfileSqlite.Image == 1);
        }