コード例 #1
0
        public void LoadApplicationStacks_Test()
        {
            StackHierarchy hierarchy = new StackHierarchy();

            using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString))
            {
                StackGatewayBase gateway = new ApplicationStackGateway(dt.Transaction);
                gateway.Load(hierarchy);
            }

            Assert.IsNotNull(hierarchy);
            Assert.IsNotNull(hierarchy.Stacks);
            Assert.IsTrue(hierarchy.Stacks.Count > 0);
            Debug.WriteLine("ApplicationStacks:{0}", hierarchy.Stacks.Count);
            Assert.IsNotNull(hierarchy.MajorFilters);
            Assert.IsTrue(hierarchy.MajorFilters.Count > 0);
            Debug.WriteLine("MajorFilters:{0}", hierarchy.MajorFilters.Count);
            Assert.IsNotNull(hierarchy.MinorFilters);
            Assert.IsTrue(hierarchy.MinorFilters.Count > 0);
            Debug.WriteLine("MinorFilters:{0}", hierarchy.MinorFilters.Count);
            Assert.IsNotNull(hierarchy.StackLookups);
            Assert.IsTrue(hierarchy.StackLookups.Count > 0);
            Debug.WriteLine("ApplicationStackLookups:{0}", hierarchy.StackLookups.Count);

            Assert.AreEqual(hierarchy.MajorFilters.Count, hierarchy.MajorFilters.Count((item) => item.IsLoaded));
            Assert.AreEqual(hierarchy.MinorFilters.Count, hierarchy.MinorFilters.Count((item) => item.IsLoaded));
            Assert.AreEqual(hierarchy.Stacks.Count, hierarchy.StackLookups.Count((item) => item.IsLoaded));
        }
 protected void Page_Init(object sender, EventArgs e)
 {
     _hierarchy = new StackHierarchy();
     try
     {
         using (DataTransactionBase dt = new OracleDataTransaction(Configuration.StacksConnectionString))
         {
             StackGatewayBase gateway = new ApplicationStackGateway(dt.Transaction);
             gateway.Load(_hierarchy);
         }
     }
     catch (Exception ex)
     {
         _exception = ex;
     }
 }