public void StoreAsVariableXmlFromText_IncorrectXml_ReturnException() { VariableSteps steps = new VariableSteps(variableController); Action act = () => steps.StoreAsVariableXmlFromText("test", "test"); act.Should().Throw <Exception>() .WithMessage($"Expected doc not to be <null> because создать XmlDoc из строки \"test\" не удалось."); }
public void StoreAsVariableXmlFromText_IncorrectXml_ReturnException() { VariableSteps steps = new VariableSteps(variableController); Action act = () => steps.StoreAsVariableXmlFromText("test", "test"); act.Should().Throw <Exception>() .Which.Message.Contains($"Создать XmlDoc из строки \"test\" не удалось."); }
public void StoreAsVariableXmlFromText_CorrectXml_ReturnXmlDoc(string xml) { VariableSteps steps = new VariableSteps(variableController); steps.StoreAsVariableXmlFromText("test", xml); var variableCheck = variableController.GetVariable("test"); variableCheck.Type.Should().Be(typeof(XmlDocument)); variableCheck.Value.Should().NotBeNull(); }
public void StoreAsVariableXmlFromText_CorrectVariable_ReturnException() { var variable = new Variable() { Type = typeof(string), Value = string.Empty }; variableController.Variables.TryAdd("test", variable); VariableSteps steps = new VariableSteps(variableController); Action act = () => steps.StoreAsVariableXmlFromText("test", null); act.Should().Throw <Exception>() .Which.Message.Contains($"Переменная \"test\" уже существует"); }