private void AssertCalledBookmarksContext(TagBundle expected)
 {
     A.CallTo(() =>
              fakeBookmarksContext.GetBookmarksByTagBundle(expected.Name
                                                           , 0, 3))
     .MustHaveHappened();
 }
Ejemplo n.º 2
0
 public void CreateTagBundle(TagBundle tagBundle)
 {
     Context.CreateTagBundle(new Bookmarks.Common.TagBundle
     {
         Name = tagBundle.Name
         ,
         Tags        = tagBundle.Tags.Select(t => t.Tag).ToArray(),
         ExcludeTags = tagBundle.ExcludeTags.Select(t => t.Tag).ToArray()
     });
 }
Ejemplo n.º 3
0
 public void UpdateTagBundleById(TagBundle tagBundle)
 {
     Context.UpdateTagBundleById(
         new Bookmarks.Common.TagBundle
     {
         Id = tagBundle.Id
         ,
         Name = tagBundle.Name
         ,
         Tags = tagBundle.Tags.Select(t => t.Tag).ToArray()
         ,
         ExcludeTags = tagBundle.ExcludeTags.Select(t => t.Tag).ToArray()
         ,
         ExcludeTagBundles = tagBundle.ExcludeTagBundles
     });
 }
Ejemplo n.º 4
0
        //[TestCase("580f053784e39a3724a7ad13", "trading", "test1,test2", "xTest1,xTest2")]
        //[TestCase("571dbbd6083989dcf1e6e92e", "diy", "embedded,robotics,diy,arduino,3dprinting,raspberrypi,openhardware,sensors,instructables,rfid,robots,microcontrollers,repair,exoskeleton", "")]
        public void TestUpdateTagBundleById(string bundleId
                                            , string name
                                            , string tags
                                            , string exclTags)
        {
            var tagBundle2Update = new TagBundle
            {
                Id = bundleId
                ,
                Name = name
                ,
                Tags = tags.Split(',').ToArray()
                ,
                ExcludeTags = exclTags.Split(',').ToArray()
            };

            Context.UpdateTagBundleById(tagBundle2Update);
        }
Ejemplo n.º 5
0
        //[TestCase("mstech"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\mstech-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4mstech.txt")]
        //[TestCase("security"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\security-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4security.txt")]
        //[TestCase("android"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\mobile-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-android.txt")]
        //[TestCase("machine-learning"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\ML-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-ML.txt")]
        //[TestCase("diy"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\diy-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-diy.txt")]
        //[TestCase("computer-networks"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\computer-networks-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-computer-networks.txt")]
        //[TestCase("books"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\books-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-books.txt")]
        //[TestCase("linux"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\linux-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-linux.txt")]
        //[TestCase("cryptocurrencies"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\cryptocurrencies-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-cryptocurrencies.txt")]
        //[TestCase("video"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\video-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-video.txt")]
        //[TestCase("tools", @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\tools-top-tags.txt"
        //        , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-tools.txt")]
        //[TestCase("sourcecode"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\sourcecode-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-sourcecode.txt")]
        //[TestCase("communication"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\communication-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-communication.txt")]
        //[TestCase("virtualization"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\virtualization-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-virtualization.txt")]
        //[TestCase("webdev"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\webdev-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-webdev.txt")]
        //[TestCase("moocs"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\moocs-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-moocs.txt")]
        //[TestCase("cryptography", @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\cryptography-top-tags.txt"
        //       , @"C:\code\csharp6\Tagging-Util\solr_import_util\storage\exclude-list4-cryptography.txt")]
        public void TestUpdateTagBundle(string name
                                        , string tagBundleFile
                                        , string excludeFile)
        {
            var tagBundle2Update = new TagBundle
            {
                Name = name
                ,
                Tags = new string[] { }
                ,
                ExcludeTags = new string[] { }
            };

            tagBundle2Update.Tags        = LoadTagBundle(tagBundleFile).ToArray();
            tagBundle2Update.ExcludeTags = LoadTagBundle(excludeFile).ToArray();

            Context.UpdateTagBundle(tagBundle2Update);
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> OnGetAsync()
        {
            if (TagID == -1)
            {
                TB = new TagBundle();

                TB.Name = "Undefined";
                Response.Redirect("/");
                return(Page());
            }
            string result = "";

            result = await DS.GetAsync("Tag/GetItemsForTag/" + TagID);

            TB = Newtonsoft.Json.JsonConvert.DeserializeObject <TagBundle>(result);

            return(Page());
        }
        public BookmarkContextTests()
        {
            fakeBookmarksContext = A.Fake <IBookmarksContext>();
            sut = new Browser(with =>
            {
                with.Dependency(fakeBookmarksContext);
                with.Module <BookmarkCollectionRepository>();
            });

            tagBundle = new TagBundle {
                Name = "linux"
            };
            //bookmarks = new Bookmark()
            //{
            //    Id = "57146c5f083989dcf1e69c4c"
            //    , LinkText = "LinuxCNC"
            //    , LinkUrl = "http://www.linuxcnc.org/"
            //    , Tags = new List<string>() { "cnc", "3dprinting", "linux", "opensource" }
            //};
        }
Ejemplo n.º 8
0
 public void UpdateExcludeTagBundlesList(TagBundle tagBundle)
 {
     Context.UpdateExcludeTagBundlesList(tagBundle.Id, tagBundle.ExcludeTagBundles);
 }
Ejemplo n.º 9
0
 public void UpdateTagBundleNameById(TagBundle tagBundle)
 {
     Context.EditTagBundle(tagBundle.Id, tagBundle.Name);
 }
Ejemplo n.º 10
0
 public void UpdateExcludeList(TagBundle tagBundle)
 {
     Context.UpdateExcludeList(tagBundle.Id, tagBundle.ExcludeTags.Select(t => t.Tag).ToArray());
 }
Ejemplo n.º 11
0
 //[TestCase("trading", "57e13f7e84e39a17d49bb198")]
 public void TestCreateTagBundle(string name, string bookmarkCollectionsId)
 {
     Context.CreateTagBundle(TagBundle.Create(name, new string[] { bookmarkCollectionsId }));
 }
 public void UpdateExcludeList(TagBundle tagBundle)
 {
     BookmarksContext.UpdateExcludeList(tagBundle.Id, tagBundle.ExcludeTags);
 }
 public void UpdateTagBundleById(TagBundle tagBundle)
 {
     BookmarksContext.UpdateTagBundleById(tagBundle);
 }
 public void CreateTagBundle(TagBundle tagBundle)
 {
     BookmarksContext.CreateTagBundle(tagBundle);
 }