コード例 #1
0
ファイル: BaseLayoutEngineTests.cs プロジェクト: kurtrips/tc
        public void SetUp()
        {
            UnitTestHelper.LoadConfigManager();

            configForCtor = UnitTestHelper.GetTestConfig();
            ble           = new LayoutEngine(configForCtor);

            blept = new BaseLayoutEngineProtectedTests();

            md = UnitTestHelper.GetSampleMapData();
        }
コード例 #2
0
ファイル: BaseLayoutEngineTests.cs プロジェクト: kurtrips/tc
 /// <summary>
 /// Tests the PerformLayout method when mapdata is invalid and LayoutException is thrown.
 /// MapData PerformLayout(MapData mapdata)
 /// LayoutException is expected.
 /// </summary>
 public void TestPerformLayoutFail2()
 {
     try
     {
         //Forces a LayoutException
         MapData md = UnitTestHelper.GetSampleMapData();
         md.Nodes.Clear();
         PerformLayout(md);
     }
     catch (Exception e)
     {
         Assert.AreEqual(typeof(LayoutException), e.GetType(), "Must throw error of type LayoutException.");
     }
 }
コード例 #3
0
        public void DemoTest()
        {
            //The MapData and IConfiguration come from external sources.
            MapData        input  = UnitTestHelper.GetSampleMapData();
            IConfiguration config = UnitTestHelper.GetTestConfig();

            //Usage is extremely simple.

            //create a new engine with configuration data
            LayoutEngine layoutEngine = new LayoutEngine(config);

            Console.WriteLine("MAPDATA INFO BEFORE LAYOUT:");
            DisplayMapdataInfo(input);

            // process layout request for some data
            MapData ret = layoutEngine.Layout(input);

            Console.WriteLine("MAPDATA INFO AFTER LAYOUT:");
            DisplayMapdataInfo(ret);
        }