Пример #1
0
        static void Main(string[] args)
        {
            var controller = new IndexController();
            controller.IndexFile(@"data\TestData.txt");

            var output = new Output();
            output.Print(controller.IndexedLines);
        }
Пример #2
0
        public void ExecQuery()
        {
            var c = new IndexController {
                Session = session,
                Cfg     = NHWebConsoleSetup.Configuration(),
                RawUrl  = "/pepe.aspx",
            };
            var model = new Context {
                Query       = "from System.Object",
                QueryType   = QueryType.HQL,
                ImageFields = new string[0],
            };

            c.ExecQuery(model);
            Assert.IsNotNull(model.Results);
            Assert.Greater(model.Results.Count, 0);
            foreach (var r in model.Results)
            {
                foreach (var m in r)
                {
                    Console.WriteLine("{0}: {1}", m.Key, m.Value);
                }
            }
        }
Пример #3
0
        public void HomeControllerIndexIndexViewModel_SlashPage_Test()
        {
            var fakeQuery = new FakeIQuery(new List <FileIndexItem>
            {
                new FileIndexItem("/")
                {
                    IsDirectory = true
                },
                new FileIndexItem("/test.jpg")
                {
                    Tags = "test", FileHash = "test"
                }
            });

            var controller = new IndexController(fakeQuery, new AppSettings());

            controller.ControllerContext.HttpContext = new DefaultHttpContext();
            var actionResult = controller.Index("/") as JsonResult;

            Assert.AreNotEqual(actionResult, null);
            var jsonCollection = actionResult.Value as ArchiveViewModel;

            Assert.AreEqual("test", jsonCollection.FileIndexItems.FirstOrDefault().FileHash);
        }
Пример #4
0
    /// Creates a scrollable list that works page by page using widgets that are
    /// created on demand.
    ///
    /// This constructor is appropriate for page views with a large (or infinite)
    /// number of children because the builder is called only for those children
    /// that are actually visible.
    ///
    /// Providing a non-null [itemCount] lets the [PageView] compute the maximum
    /// scroll extent.
    ///
    /// [itemBuilder] will be called only with indices greater than or equal to
    /// zero and less than [itemCount].
    public TransformerPageView(

        int index,
        Curve curve,
        ScrollPhysics physics,
        ValueChanged <int> onPageChanged,
        IndexController controller,
        PageTransformer transformer,
        IndexedWidgetBuilder itemBuilder,
        TransformerPageController pageController,
        int itemCount,
        TimeSpan?duration      = null,
        Key key                = null,
        float viewportFraction = 1,
        Axis scrollDirection   = Axis.horizontal,
        bool loop              = false,
        bool pageSnapping      = true
        ) : base(key: key)
    {
        this.index            = index;
        this.curve            = curve == null ? Curves.ease : curve;
        this.loop             = loop;
        this.scrollDirection  = scrollDirection;
        this.physics          = physics;
        this.onPageChanged    = onPageChanged;
        this.controller       = controller;
        this.transformer      = transformer;
        this.itemBuilder      = itemBuilder;
        this.pageController   = pageController;
        this.itemCount        = itemCount;
        this.viewportFraction = viewportFraction;
        this.scrollDirection  = scrollDirection;
        this.loop             = loop;
        this.pageSnapping     = pageSnapping;
        this.duration         = duration ?? TimeSpan.FromMilliseconds(kDefaultTransactionDuration);
    }
Пример #5
0
        private static void LibraryIndexPicker(string choice)
        {
            indexController = new IndexController();
            switch (choice)
            {
            case "1":
                Console.WriteLine("All the books available in the Library.");
                indexController.GetAllBooks();
                break;

            case "2":
                indexController.CreateBook();
                break;

            case "3":
                Console.WriteLine("Select a user.");
                indexController.SelectUsers();
                break;

            default:
                Console.WriteLine("Not in the list");
                break;
            }
        }
Пример #6
0
 public override void MakeController()
 {
     _controller = new IndexController();
     _controller.Initialize(_model, this);
     _controller.OnViewLoaded();
 }
Пример #7
0
 public void Setup()
 {
     this.controller = new IndexController();
 }
Пример #8
0
 public IndexControllerTest()
 {
     _api             = new KuzzleApiMock();
     _indexController = new IndexController(_api.MockedObject);
 }
Пример #9
0
 public CacheProvider(IndexController indexController)
     : this(indexController, false)
 {
 }
 /// <summary>
 /// Initializes the page and the controller for the specified type.
 /// </summary>
 /// <param name="type"></param>
 /// <param name="isPaged"></param>
 public void Initialize(Type type, bool isPaged)
 {
     Command    = new IndexCommandInfo(type.Name);
     controller = IndexController.New(this);
 }