public void ChangeVariable_CorrectVariable_ReturnException() { VariableSteps steps = new VariableSteps(variableController); Action act = () => steps.ChangeVariable("test", 0); act.Should().Throw <Exception>() .WithMessage("Expected this.variableController.Variables {empty} to contain key \"test\" because переменная \"test\" не существует."); }
public void ChangeVariable_CorrectVariable_ReturnException() { VariableSteps steps = new VariableSteps(variableController); Action act = () => steps.ChangeVariable("test", 0); act.Should().Throw <Exception>() .Which.Message.Contains("переменная \"test\" не существует"); }
public void ChangeVariable_IntValue_ReturnNewVariable() { var variable = new Variable() { Type = typeof(string), Value = string.Empty }; variableController.Variables.TryAdd("test", variable); VariableSteps steps = new VariableSteps(variableController); steps.ChangeVariable("test", 0); var variableCheck = variableController.GetVariable("test"); variableCheck.Type.Should().Be(typeof(int)); variableCheck.Value.Should().Be(0); }