Ejemplo n.º 1
0
        public void InputANumberOfLineItMustGenerateTriangle(string expected, int inputLine)
        {
            var svc    = new Homework08();
            var actual = svc.GetTriangleShapeAsText(inputLine);

            Assert.Equal(expected, actual);
        }
        public void GetTriangleShapeAsText_Fail(int input)
        {
            var drawShapeCalculate = new Homework08();
            var result             = drawShapeCalculate.GetTriangleShapeAsText(input);

            Assert.Empty(result);
        }
Ejemplo n.º 3
0
        public void TestGetTriangleShapeAsText(int number, string expectTriangle)
        {
            var sut    = new Homework08();
            var result = sut.GetTriangleShapeAsText(number);

            Assert.Equal(expectTriangle, result);
        }
        public void GetTriangleShapeAsText_Success(int input, string expected)
        {
            var drawShapeCalculate = new Homework08();
            var result             = drawShapeCalculate.GetTriangleShapeAsText(input);

            Assert.Equal(expected, result);
        }
Ejemplo n.º 5
0
        public void Test1(int input, string expected)
        {
            var sut    = new Homework08();
            var result = sut.GetTriangleShapeAsText(input);

            Assert.Equal(expected, result);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            Console.Write("Input number : ");
            var input   = int.Parse(Console.ReadLine());
            var call    = new Homework08();
            var newText = call.GetTriangleShapeAsText(input);

            Console.WriteLine(newText);
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            Console.Write("Input data: ");
            var call   = new Homework08();
            var input  = Console.ReadLine();
            var result = call.GetTriangleShapeAsText(int.Parse(input));

            Console.Write(result);
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            var svc = new Homework08();

            while (true)
            {
                Console.WriteLine("Enter number : ");
                var result = int.TryParse(Console.ReadLine(), out var number) ? svc.GetTriangleShapeAsText(number) : "Please enter number.";
                Console.WriteLine(result);
            }
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            Console.Write($"Hello Welcome to GetTriangleShapeAsText analysis (HomeWork 08){Environment.NewLine}How many do you want to build TriangleShape height?: ");
            int.TryParse(Console.ReadLine(), out int input);

            var isValidInput = input > 0;

            if (!isValidInput)
            {
                System.Console.WriteLine("Your input must more than or equal 1.");
                return;
            }

            var control = new Homework08();
            var result  = control.GetTriangleShapeAsText(input);

            System.Console.WriteLine($"Result{Environment.NewLine}{result}");
        }