Beispiel #1
0
        /// <summary>
        /// Update a unit test method : all actions and definitions are updated. The updated unit
        /// test is available at <see cref="Test"/>.
        /// </summary>
        private void UpdateTest()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[Fact]");
            WriteLine(sb);
            sb.Append("public void Test()" + Environment.NewLine + "{");
            WriteLine(sb);
            WriteLine(sb);

            foreach (Definition definition in definitions)
            {
                WriteDefinition(definition, sb);
            }

            WriteLine(sb);
            //should allow multiple or plugin style approach to test writing

            //should allow Plugin approach to processors of actions.
            ICollection <Action> processedActions = actions;

            processedActions = new EnterSelectTextCollapsingProcessor().Process(processedActions);
            processedActions = new EnterTextCollapsingProcessor().Process(processedActions);

            foreach (Action action in processedActions)
            {
                WriteAction(action.ToString(), sb);
            }

            WriteLine(sb);
            sb.Append("}");

            Test = sb.ToString();
        }
Beispiel #2
0
        /// <summary>
        /// Update a unit test method : all actions and definitions are updated. The updated unit
        /// test is available at <see cref="Test"/>.
        /// </summary>
        private void UpdateTest()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[Fact]");
            WriteLine(sb);
            sb.Append("public void Test()" + Environment.NewLine + "{");
            WriteLine(sb);
            WriteLine(sb);

            foreach (Definition definition in definitions)
            {
                WriteDefinition(definition, sb);
            }

            WriteLine(sb);
            //should allow multiple or plugin style approach to test writing

            //should allow Plugin approach to processors of actions.
            ICollection<Action> processedActions = actions;

            processedActions = new EnterSelectTextCollapsingProcessor().Process(processedActions);
            processedActions = new EnterTextCollapsingProcessor().Process(processedActions);

            foreach (Action action in processedActions)
            {
                WriteAction(action.ToString(), sb);
            }

            WriteLine(sb);
            sb.Append("}");

            Test = sb.ToString();
        }