Esempio n. 1
0
        public void CheckVariableIsEmpty_CorrectVarName_ReturnTrue()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = string.Empty
            };

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

            VariableSteps steps = new VariableSteps(variableController);

            steps.CheckVariableIsEmpty("test");
        }
Esempio n. 2
0
        public void CheckVariableIsEmpty_VariableValueIsEmpty_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = "test"
            };

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

            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.CheckVariableIsEmpty("test");

            act.Should().Throw <Exception>()
            .WithMessage($"Expected string.IsNullOrWhiteSpace((string)value) to be true because значение переменной \"test\" не пустая строка, but found False.");
        }
Esempio n. 3
0
        public void CheckVariableIsEmpty_VariableValueIsNull_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = null
            };

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

            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.CheckVariableIsEmpty("test");

            act.Should().Throw <Exception>()
            .WithMessage($"Expected value not to be <null> because значения в переменной \"test\" нет.");
        }
        public void CheckVariableIsEmpty_VariableValueIsEmpty_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = "test"
            };

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

            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.CheckVariableIsEmpty("test");

            act.Should().Throw <Exception>()
            .Which.Message.Contains($"Значение переменной \"test\" не пустая строка");
        }