Exemplo n.º 1
0
        public void CheckVariableIsNotEmpty_CorrectVarName_ReturnTrue()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = "test"
            };

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

            VariableSteps steps = new VariableSteps(variableController);

            steps.CheckVariableIsNotEmpty("test");
        }
Exemplo n.º 2
0
        public void CheckVariableIsNotEmpty_VariableValueIsEmpty_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = string.Empty
            };

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

            VariableSteps steps = new VariableSteps(variableController);

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

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

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

            VariableSteps steps = new VariableSteps(variableController);

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

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

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

            VariableSteps steps = new VariableSteps(variableController);

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

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