コード例 #1
0
        public void Get_Sector_Counts_test()
        {
            Continuum thisInst = new Continuum("");

            string Filename = testingFolder + "\\MCP testing.cfm";

            thisInst.Open(Filename);
            Met thisMet = thisInst.metList.metItem[0];
            MCP thisMCP = thisMet.mcp;

            thisInst.metList.numWD     = 16;
            thisInst.metList.numTOD    = 1;
            thisInst.metList.numSeason = 1;
            thisMCP.numWD      = 16;
            thisMCP.numTODs    = 1;
            thisMCP.numSeasons = 1;
            thisMCP.Find_Sector_Counts(thisInst.metList);

            // Test 1
            Assert.AreEqual(thisMCP.GetSectorCount(0, Met.TOD.All, Met.Season.All, thisInst.metList), 4204, 0, "Wrong sector count in Test 1");

            thisInst.metList.numWD     = 16;
            thisInst.metList.numTOD    = 2;
            thisInst.metList.numSeason = 1;
            thisMCP.numWD      = 16;
            thisMCP.numTODs    = 2;
            thisMCP.numSeasons = 1;
            thisMCP.Find_Sector_Counts(thisInst.metList);

            // Test 2
            Assert.AreEqual(thisMCP.GetSectorCount(15, Met.TOD.Day, Met.Season.All, thisInst.metList), 2629, 0, "Wrong sector count in Test 2");

            // Test 3
            Assert.AreEqual(thisMCP.GetSectorCount(1, Met.TOD.Night, Met.Season.All, thisInst.metList), 2081, 0, "Wrong sector count in Test 3");

            thisInst.metList.numWD     = 8;
            thisInst.metList.numTOD    = 1;
            thisInst.metList.numSeason = 4;
            thisMCP.numWD      = 8;
            thisMCP.numTODs    = 1;
            thisMCP.numSeasons = 4;
            thisMCP.Find_Sector_Counts(thisInst.metList);

            // Test 4
            Assert.AreEqual(thisMCP.GetSectorCount(6, Met.TOD.All, Met.Season.Winter, thisInst.metList), 6217, 0, "Wrong sector count in Test 4");

            // Test 5
            Assert.AreEqual(thisMCP.GetSectorCount(3, Met.TOD.All, Met.Season.Spring, thisInst.metList), 1997, 0, "Wrong sector count in Test 5");

            // Test 6
            Assert.AreEqual(thisMCP.GetSectorCount(0, Met.TOD.All, Met.Season.Summer, thisInst.metList), 2567, 0, "Wrong sector count in Test 6");

            // Test 7
            Assert.AreEqual(thisMCP.GetSectorCount(7, Met.TOD.All, Met.Season.Fall, thisInst.metList), 2811, 0, "Wrong sector count in Test 7");

            thisInst.metList.numWD     = 24;
            thisInst.metList.numTOD    = 2;
            thisInst.metList.numSeason = 4;
            thisMCP.numWD      = 24;
            thisMCP.numTODs    = 2;
            thisMCP.numSeasons = 4;
            thisMCP.Find_Sector_Counts(thisInst.metList);

            // Test 8
            Assert.AreEqual(thisMCP.GetSectorCount(19, Met.TOD.Day, Met.Season.Fall, thisInst.metList), 686, 0, "Wrong sector count in Test 8");

            thisInst.Close();
        }