Exemple #1
0
        public void TestMethod2_Jane_Married()
        {
            IPerson Jane = new Taiwanese("婷婷");

            Jane.Age = 40;
            bool married = true;

            Assert.AreEqual(Jane.Married(Jane.Age), married);
            log.Info("Jane 結婚了" + Jane.Married(Jane.Age));
        }
Exemple #2
0
        public void TestMethod1_Jane_Na_Age()
        {
            IPerson Jane = new Taiwanese("婷婷");

            Jane.Age = 40;
            var varifying = "中華台北";

            Assert.AreEqual(Jane.Nationality,varifying);
            log.Info("Jane 來自"+Jane.Nationality);
            Assert.AreEqual(Jane.Age, 40);
            log.Info("Jane 的年齡" + Jane.Age);
            log.Debug("haha");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            //if Properties -> AssemblyInfo.cs加入
            //[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config",Watch = true)]
            //then 可以不用寫此段程式碼
            //XmlConfigurator.Configure(new System.IO.FileInfo("./log4net.config"));
            log.Debug("123");

            IPerson Tom = new Taiwanese("阿忠");
            Tom.Age = 25;
            Console.WriteLine("{0} comes from {1}.", Tom.Name, Tom.Nationality);
            Console.WriteLine("How old is he/she? {0} Did he/she get married? {1}", Tom.Age, Tom.Married(Tom.Age));

            Console.WriteLine();

            IPerson Joe = new Taiwanese("忠忠");
            Joe.Age = 25;
            Console.WriteLine("{0} comes from {1}.", Joe.Name, Joe.Nationality);
            Console.WriteLine("How old is he/she? {0} Did he/she get married? {1}", Joe.Age, Joe.Married(Joe.Age));

            Console.ReadKey();
        }