Exemple #1
0
        public void GetsWordCount()
        {
            _getWordCount = new GetWordCountCommand();
            _engine       = new AutomationEngineInstance(null);

            string input = "Test input sentence";

            VariableMethods.CreateTestVariable(input, _engine, "input", typeof(string));
            VariableMethods.CreateTestVariable(null, _engine, "output", typeof(int));

            _getWordCount.v_InputValue             = "{input}";
            _getWordCount.v_OutputUserVariableName = "{output}";

            _getWordCount.RunCommand(_engine);

            Assert.Equal(3, Int32.Parse(_getWordCount.v_OutputUserVariableName.ConvertUserVariableToString(_engine)));
        }
Exemple #2
0
 public void Setup()
 {
     _repository             = new MockRepository(MockBehavior.Strict);
     _wordCounterServiceMock = _repository.Create <IWordCounterService>();
     _wordCountCommand       = new GetWordCountCommand(_wordCounterServiceMock.Object);
 }