Example #1
0
    public int solution(string S)
    {
        // write your code in C# 6.0 with .NET 4.5 (Mono)
        var wm = new WordMachine();

        return(wm.ExecuteWordMachine(S));
    }
    public static void Run()
    {
        string input1 = "3 DUP 5 - -";
        string input2 = "13 DUP 4 POP 5 DUP + DUP + -";
        var    result = new WordMachine().solution(input2);

        Console.WriteLine(result);
    }
        public void Return_Negative_1_Given_Empty_Expression()
        {
            // Arrange
            var machine    = new WordMachine();
            var expression = "";

            // Act
            var actual = machine.Solution(expression);

            // Assert
            Assert.Equal(-1, actual);
        }
        public void Return_7_Given_13_DUP_4_POP_5_DUP_Plus_DUP_Plus_Minus()
        {
            // Arrange
            var machine    = new WordMachine();
            var expression = "13 DUP 4 POP 5 DUP + DUP + -";

            // Act
            var actual = machine.Solution(expression);

            // Assert
            Assert.Equal(7, actual);
        }
        public void Return_Negative_1_Given_5_5_Minus_Pop()
        {
            // Arrange
            var machine    = new WordMachine();
            var expression = "5 5 - POP";

            // Act
            var actual = machine.Solution(expression);

            // Assert
            Assert.Equal(-1, actual);
        }
Example #6
0
        public void 두단어_줄바꿈하기()
        {
            string inputString    = "hello world";
            string expectedString = "hello--world";
            string actualString   = "";

            WordMachine wordMachine = new WordMachine();

            actualString = wordMachine.wrap(inputString, 7);

            Assert.AreEqual(expectedString, actualString);
        }
Example #7
0
 public void WordWrapper_인스턴스_만들기()
 {
     WordMachine wordMachine = new WordMachine();
 }