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

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

            VariableSteps steps = new VariableSteps(variableController);

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

            variableController.Variables.TryAdd("test", variable);
            VariableSteps steps = new VariableSteps(variableController);

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

            act.Should().Throw <Exception>()
            .WithMessage($"Expected actual to start with \"mp\" because значение переменной \"test\":\"test\" не начинается с \"mp\", but \"test\" differs near \"tes\" (index 0).");
        }
Exemplo n.º 3
0
        public void CheckVariableStartsWith_InCorrectActual_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = null
            };

            variableController.Variables.TryAdd("test", variable);
            VariableSteps steps = new VariableSteps(variableController);

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

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

            variableController.Variables.TryAdd("test", variable);
            VariableSteps steps = new VariableSteps(variableController);

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

            act.Should().Throw <Exception>()
            .WithMessage($"Expected expected not to be <null> because значение \"expected\" не задано.");
        }
        public void CheckVariableStartsWith_InCorrectEquals_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = "test"
            };

            variableController.Variables.TryAdd("test", variable);
            VariableSteps steps = new VariableSteps(variableController);

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

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