public void Gua8CkonstrucktorTest() { Gua8 qian = Gua8.Get(7); Gua8 qian1 = Gua8.Get("乾"); Gua8 qian2 = Gua8.Get("天"); Gua8 qian3 = Gua8.Get("乾为天"); Assert.AreEqual("乾", qian.Name); Assert.AreEqual(qian, qian1); Assert.AreEqual(qian1, qian2); Assert.AreEqual(qian2, qian3); Assert.AreEqual(艮, Gua8.Get("艮为山")); Assert.AreEqual(nameof(坤), 坤.Name); Assert.AreEqual(nameof(震), 震.Name); Assert.AreEqual(nameof(坎), 坎.Name); Assert.AreEqual(nameof(兑), 兑.Name); Assert.AreEqual(nameof(艮), 艮.Name); Assert.AreEqual(nameof(离), 离.Name); Assert.AreEqual(nameof(巽), 巽.Name); Assert.AreEqual(nameof(乾), 乾.Name); Assert.AreEqual("地", 坤.Name2); Assert.AreEqual("雷", 震.Name2); Assert.AreEqual("水", 坎.Name2); Assert.AreEqual("泽", 兑.Name2); Assert.AreEqual("山", 艮.Name2); Assert.AreEqual("火", 离.Name2); Assert.AreEqual("风", 巽.Name2); Assert.AreEqual("天", 乾.Name2); }
static void PrintBaGua() { List <int> BaGua = new List <int> { 0, 1, 2, 3, 4, 5, 6, 7 }; foreach (var item in BaGua) { Gua8 gua = new Gua8(item); Console.WriteLine(string.Format("{0} :{1}", gua.Name, gua.YaoStr)); } Console.WriteLine(); Console.WriteLine(); }