示例#1
0
 public void Ex01_TestWithName1()
 {
     TestHelper help = new TestHelper();
     help.SetupConsole(new string[] {"John"});
     Ex01.Main(null);
     help.AssertOutput("Good Morning John");
 }
示例#2
0
 public void Ex16_TestWithFemale()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "Jane Austen","F"});
     TestHelper.RunMain(typeof (Ex16));
     t.AssertOutput("Good Morning Ms. Jane Austen".ToString());
 }
示例#3
0
 public void ExB10_TestWithPositiveNumber()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "3","4","5"});
     TestHelper.RunMain(typeof (ExB10));
     t.AssertOutput(6.ToString());
 }
示例#4
0
 public void ExB10_TestWithZero()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "0", "0", "0" });
     TestHelper.RunMain(typeof(ExB10));
     t.AssertOutput(0.ToString());
 }
示例#5
0
 public void Ex10_TestWithPositiveNumber()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "20","0","20","20"});
     TestHelper.RunMain(typeof (Ex10));
     t.AssertOutput(20.ToString());
 }
示例#6
0
 public void Ex16_TestWithMale()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "John Smith", "M"});
     TestHelper.RunMain(typeof(Ex16));
     t.AssertOutput("Good Morning Mr. John Smith".ToString());
 }
示例#7
0
 public void Ex17_TestWithMs()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "Ariana Grande", "F", "18" });
     TestHelper.RunMain(typeof(Ex17));
     t.AssertOutput("Good Morning Ms. Ariana Grande".ToString());
 }
示例#8
0
 public void Ex17_TestWitMr()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "Will Smith", "M" });
     TestHelper.RunMain(typeof(Ex17));
     t.AssertOutput("Good Morning Mr. Will Smith".ToString());
 }
示例#9
0
 public void Ex14_TestWithPositiveNumber()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "3","4","5"});
     TestHelper.RunMain(typeof (Ex14));
     t.AssertOutput(6.ToString());
 }
示例#10
0
 public void Ex17_TestWithAunty()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "Madonna", "F", "51" });
     TestHelper.RunMain(typeof (Ex17));
     t.AssertOutput("Good Morning Aunty Madonna".ToString());
 }
示例#11
0
 public void Ex14_TestWithZero()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "0", "0", "0" });
     TestHelper.RunMain(typeof(Ex14));
     t.AssertOutput(0.ToString());
 }
示例#12
0
 public void Ex10_TestWithNegativeNumber()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "20", "0", "-20", "-20" });
     TestHelper.RunMain(typeof(Ex10));
     t.AssertOutput(Math.Sqrt(40*40+20*20).ToString());
 }
示例#13
0
 public void Ex17_TestWithUncle()
 {
     TestHelper t = new TestHelper();
     t.SetupConsole(new string[] { "Arnold", "M", "40"});
     TestHelper.RunMain(typeof(Ex17));
     t.AssertOutput("Good Morning Uncle Arnold".ToString());
 }
示例#14
0
        public void ExC2_TestWithUncle()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "Arnold", "M", "40" });
            TestHelper.RunMain(typeof(ExC2));
            t.AssertOutput("Good Morning Uncle Arnold".ToString());
        }
示例#15
0
        public static void TestOutputEqual(Type t,  string input, string output)
        {
            TestHelper help = new TestHelper();

            help.SetupConsole(input);
            RunMain(t);
            help.AssertOutput(output);
        }
示例#16
0
        public void ExB6_TestWithNegativeNumber()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "20", "0", "-20", "-20" });
            TestHelper.RunMain(typeof(ExB6));
            t.AssertOutput(Math.Sqrt(40 * 40 + 20 * 20).ToString());
        }
示例#17
0
        public void ExB6_TestWithPositiveNumber()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "20", "0", "20", "20" });
            TestHelper.RunMain(typeof(ExB6));
            t.AssertOutput(20.ToString());
        }
示例#18
0
        public static void TestOutputEqual(Type t, string input, string output)
        {
            TestHelper help = new TestHelper();

            help.SetupConsole(input);
            RunMain(t);
            help.AssertOutput(output);
        }
示例#19
0
        public void ExC1_TestWithMale()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "John Smith", "M" });
            TestHelper.RunMain(typeof(ExC1));
            t.AssertOutput("Good Morning Mr. John Smith".ToString());
        }
示例#20
0
        public void ExC2_TestWithMs()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "Ariana Grande", "F", "18" });
            TestHelper.RunMain(typeof(ExC2));
            t.AssertOutput("Good Morning Ms. Ariana Grande".ToString());
        }
示例#21
0
        public void ExC2_TestWitMr()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "Will Smith", "M" });
            TestHelper.RunMain(typeof(ExC2));
            t.AssertOutput("Good Morning Mr. Will Smith".ToString());
        }
示例#22
0
        public void ExC2_TestWithAunty()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "Madonna", "F", "51" });
            TestHelper.RunMain(typeof(ExC2));
            t.AssertOutput("Good Morning Aunty Madonna".ToString());
        }
示例#23
0
        public void ExC1_TestWithFemale()
        {
            TestHelper t = new TestHelper();

            t.SetupConsole(new string[] { "Jane Austen", "F" });
            TestHelper.RunMain(typeof(ExC1));
            t.AssertOutput("Good Morning Ms. Jane Austen".ToString());
        }
示例#24
0
        public void Ex01_TestWithName1()
        {
            TestHelper help = new TestHelper();

            help.SetupConsole(new string[] { "John" });
            Ex01.Main(null);
            help.AssertOutput("Good Morning John");
        }