Esempio n. 1
0
        public void should_Update_Sections()
        {
            _tableauWorkbookWithViews = TestHelpers.GetTableauWorkbooks();
            _tableauViews             = TestHelpers.GetTableauViews();
            _tableauViewConfigs       = TestHelpers.GetViewConfigs();
            _contextOptions           = TestDbOptions.GetInMemoryOptions <DwhDashboardContext>();
            _context = new DwhDashboardContext(_contextOptions);

            TestHelpers.CreateTestData(_context, _tableauViewConfigs);
            TestHelpers.CreateTestData(_context, _tableauWorkbookWithViews);
            TestHelpers.CreateTestData(_context, _tableauViews);

            _repository = new TabViewRepository(_context);
            var updates = _repository.UpdateSections().Result;

            _repository = new TabViewRepository(_context);
            var filteredList = _repository.GetViewsFiltered()
                               .FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.CustomParentName));

            var filteredListRank = _repository.GetViewsFiltered()
                                   .FirstOrDefault(x => x.Rank.HasValue);

            Assert.IsNotNull(filteredList);
            Console.WriteLine($"{filteredList.Name}|{filteredList.CustomParentName}");

            Assert.IsNotNull(filteredListRank);
            Console.WriteLine($"{filteredListRank.Name}|{filteredListRank.CustomParentName}");
        }
Esempio n. 2
0
        public void should_GetAll_Filtered(string display)
        {
            _tableauWorkbookWithViews = TestHelpers.GetTableauWorkbooks();
            _tableauViews             = TestHelpers.GetTableauViews();
            _tableauViewConfigs       = TestHelpers.GetViewConfigs();
            _contextOptions           = TestDbOptions.GetInMemoryOptions <DwhDashboardContext>();
            _context = new DwhDashboardContext(_contextOptions);

            TestHelpers.CreateTestData(_context, _tableauViewConfigs);
            TestHelpers.CreateTestData(_context, _tableauWorkbookWithViews);
            TestHelpers.CreateTestData(_context, _tableauViews);

            _repository = new TabViewRepository(_context);
            var updates = _repository.UpdateSections().Result;

            _repository = new TabViewRepository(_context);

            var filteredList = _repository.GetViewsFiltered().ToList();

            Assert.IsNotEmpty(filteredList);
            filteredList = filteredList
                           .Where(x => x.CustomParentName.ToLower() == display.ToLower())
                           .ToList();
            Console.WriteLine(display);
            Console.WriteLine(new string('+', 40));
            int n = 0;

            foreach (var v in filteredList)
            {
                n++;
                Console.WriteLine($"  {n}. {v.Name}");
            }
            Console.WriteLine(new string('-', 40));
            Console.WriteLine(new string('-', 40));
        }
Esempio n. 3
0
        public void should_Get_ViewsFiltered()
        {
            _tableauWorkbookWithViews = TestHelpers.GetTableauWorkbooks();
            _tableauViews             = TestHelpers.GetTableauViews();
            _tableauViewConfigs       = TestHelpers.GetViewConfigs();
            _contextOptions           = TestDbOptions.GetInMemoryOptions <DwhDashboardContext>();
            _context = new DwhDashboardContext(_contextOptions);

            TestHelpers.CreateTestData(_context, _tableauViewConfigs);
            TestHelpers.CreateTestData(_context, _tableauWorkbookWithViews);
            TestHelpers.CreateTestData(_context, _tableauViews);

            _repository = new TabViewRepository(_context);
            var updates = _repository.UpdateSections().Result;

            _repository = new TabViewRepository(_context);
            var filteredList = _repository.GetViewsFiltered().ToList();

            Assert.IsNotEmpty(filteredList);
            foreach (var v in filteredList)
            {
                Console.WriteLine($"{v.Name}|{v.CustomParentName}");
            }
        }