コード例 #1
0
        static void Main(string[] args)
        {
            string textData = GetTestData(args);

            if (string.IsNullOrEmpty(textData))
            {
                Console.WriteLine("Get Test Data Failed");
            }
            else
            {
                var parser   = new ArgsParser(textData);
                var texiArgs = parser.GetArgs();
                var priceCal = new TexiPriceCalculor();
                texiArgs.ForEach(arg => Console.WriteLine(string.Format(pricePrintFormat, priceCal.GetPrice(arg))));
            }

            Console.ReadKey();
        }
コード例 #2
0
        public void Input_2_0_Should_Return_7()
        {
            TexiPriceCalculor cal = new TexiPriceCalculor();

            Assert.AreEqual(cal.GetPrice(new TexiPriceArgs(2, 3)), 7);
        }
コード例 #3
0
        public void Input_10_0_Should_Return_13()
        {
            TexiPriceCalculor cal = new TexiPriceCalculor();

            Assert.AreEqual(cal.GetPrice(new TexiPriceArgs(10, 0)), 13);
        }