public void TestEnumAccountMembers() { HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); var ret = hfmDimension.EnumAccountMembers(); var retv = ret.FirstOrDefault(c => c.Description == "HisRate_Acquisition"); }
public void TestEnumCustomMembers() { HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); var ret = hfmDimension.EnumCustomMembers(HfmDimensionType.Custom2); var retv = ret.FirstOrDefault(c => c.Description == "TOPC2"); }
public void TestEnumEntityMembers() { HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); var ret = hfmDimension.EnumEntityMembers(); var retv = ret.FirstOrDefault(c => c.Description == "GLP Wuxi Logistics Development Co.Ltd."); }
public void TestEnumMembers2() { HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); var ret = hfmDimension.EnumMembers2(HfmDimensionType.Account); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Scenario); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom1); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom2); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom3); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Custom4); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Entity); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Icp); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Period); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.View); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Year); Assert.Less(0, ret.Count()); ret = hfmDimension.EnumMembers2(HfmDimensionType.Value); Assert.Less(0, ret.Count()); }
public void TestGetMember() { HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); var ret = hfmDimension.EnumMembers2(HfmDimensionType.Account); for (int index = 0; index < ret.Count && index < 20; index++) { DimensionMember member = ret[index]; int id = hfmDimension.GetMemberID(HfmDimensionType.Account, member.MemberLabel); Assert.AreEqual(id, member.MemberID); string label = hfmDimension.GetMemberLabel(HfmDimensionType.Account, member.MemberID); Assert.AreEqual(label, member.MemberLabel); } }
public void Test() { DataTable tesTable = CreateDataTable(); var row = tesTable.NewRow(); row["HFM_SCENARIO"] = "Actual"; row["HFM_YEAR"] = "2015"; row["HFM_PERIOD"] = "FM03"; row["HFM_VIEW"] = "YTD"; row["HFM_PARENT"] = "WOFE_ONSHORE&Partial_Offshore"; row["HFM_ENTITY"] = "Songjiang_Onshore"; row["HFM_VALUE"] = "[Elimination]"; row["HFM_ACCOUNT"] = "Plug110004_01"; row["HFM_ICP"] = "[ICP Top]"; row["HFM_CUSTOM1"] = "TopC1"; row["HFM_CUSTOM2"] = "Closing"; row["HFM_CUSTOM3"] = "TopC3"; row["HFM_CUSTOM4"] = "TopC4"; tesTable.Rows.Add(row); HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmData data = hfmSession.GetData(); data.GetCells(tesTable); tesTable = CreateDataTable(); row = tesTable.NewRow(); row["HFM_SCENARIO"] = "Actual"; row["HFM_YEAR"] = "2015"; row["HFM_PERIOD"] = "FM03"; row["HFM_VIEW"] = "YTD"; //row["HFM_PARENT"] = "WOFE_ONSHORE&Partial_Offshore"; row["HFM_ENTITY"] = "52502"; row["HFM_VALUE"] = "[Proportion]"; row["HFM_ACCOUNT"] = "20202080134"; //row["HFM_ICP"] = "[ICP Top]"; //row["HFM_CUSTOM1"] = "TopC1"; //row["HFM_CUSTOM2"] = "Closing"; //row["HFM_CUSTOM3"] = "TopC3"; //row["HFM_CUSTOM4"] = "TopC4"; tesTable.Rows.Add(row); tesTable.ImportRow(row); tesTable.Rows[tesTable.Rows.Count - 1]["HFM_ENTITY"] = "51502"; var retTable = data.ExpandData(tesTable); }
public void TestExtract() { XmlSerializer ser = new XmlSerializer(typeof(HSMETADATA), new XmlRootAttribute("HSMETADATA")); HfmSession hfmSession = HfmHelper.CreateHfmSession(); HfmDimension hfmDimension = hfmSession.GetDimension(); string filePath = Path.GetTempFileName(); string logPath = Path.GetTempFileName(); hfmDimension.Extract(filePath, logPath); HSMETADATA data; using (FileStream stream = new FileStream(filePath, FileMode.Open)) { data = (HSMETADATA)ser.Deserialize(stream); stream.Close(); } Assert.AreEqual(data.DIMENSION.Length, 7); }