Exemplo n.º 1
0
        public void StoreAsVariableNumber_IncorrectVariable_ReturnException()
        {
            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.StoreAsVariableNumber("test", "test");

            act.Should().Throw <Exception>()
            .WithMessage($"Input string was not in a correct format.");
        }
        public void StoreAsVariableNumber_CorrectVariable_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = string.Empty
            };

            variableController.Variables.TryAdd("test", variable);

            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.StoreAsVariableNumber("test", null);

            act.Should().Throw <Exception>()
            .Which.Message.Contains($"Переменная \"test\" уже существует");
        }