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

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

            VariableSteps steps = new VariableSteps(variableController);

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

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

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

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

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

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

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

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

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

            act.Should().Throw <Exception>()
            .Which.Message.Contains($"Значение переменной \"test\":\"test\" равно \"test\"");
        }
Exemplo n.º 5
0
        public void CheckVariablesAreNotEqual_InCorrectValue1_ReturnException()
        {
            var variable = new Variable()
            {
                Type = typeof(string), Value = null
            };

            variableController.Variables.TryAdd("test1", variable);
            variable = new Variable()
            {
                Type = typeof(string), Value = "test"
            };
            variableController.Variables.TryAdd("test2", variable);

            VariableSteps steps = new VariableSteps(variableController);

            Action act = () => steps.CheckVariableNotEquals("test1", "test2");

            act.Should().Throw <Exception>()
            .WithMessage($"Expected actual not to be <null> because значения в переменной \"test1\" нет.");
        }