Ejemplo n.º 1
0
        public void ManyToMany()
        {
            var c = new IndexController {
                Session = session,
                Cfg     = NHWebConsoleSetup.Configuration(),
                RawUrl  = "/pepe.aspx",
            };
            var link = c.BuildCollectionLink(typeof(Territory), typeof(Employee), 1);

            Console.WriteLine(link);
            Assert.IsNotNull(link);
        }
Ejemplo n.º 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);
                }
            }
        }