コード例 #1
0
        public void GetFormattedMethodName_ShouldReplaceSpacesWithUnderscore()
        {
            // Arrange
            executeMethodStep.MethodName = "Method Name";

            // Act
            var formattedMethodName = executeMethodStep.GetFormattedMethodName();

            // Assert
            formattedMethodName.ShouldEqual("Method_Name");
        }
コード例 #2
0
        public void Visit(ExecuteMethodStep executeMethodStep)
        {
            try
            {
                executeMethodStep.Status = ExecutionStatus.InProgress;
                var method = new TestEngine.Method(executeMethodStep.GetFormattedMethodName());
                foreach (var p in executeMethodStep.Parameters)
                {
                    method.Parameters[p.Name] = p.Value;
                }

                testEngine.MethodExecution.Execute(method);
                executeMethodStep.Status = ExecutionStatus.Passed;
                executeMethodStep.Error  = null;
            }
            catch (Exception ex)
            {
                executeMethodStep.Status = ExecutionStatus.Failed;
                executeMethodStep.Error  = ex.Message;
                hasError = true;
            }
        }