public void The_Write_Method_Creates_The_Correct_XML() { ProjectSerialiserV1 serialiser = new ProjectSerialiserV1(fileController); FunctionInfo functionInfo = new FunctionInfo("Function", typeof(string), "Body", true, SyntaxEditorHelper.ScriptLanguageTypes.CSharp, "desc", "C#", "Gen"); functionInfo.Parameters.Add(new ParamInfo("varName", typeof(int)){Modifiers = "static"}); StringBuilder sb = new StringBuilder(); XmlWriter writer = XmlWriter.Create(sb, new XmlWriterSettings{OmitXmlDeclaration = true}); serialiser.WriteFunctionXML(functionInfo, writer); writer.Close(); string output = XmlSqueezer.RemoveWhitespaceBetweenElements(sb.ToString()); Assert.That(output, Is.EqualTo(expectedXml)); }
public void The_Write_Method_Creates_The_Correct_XML() { ProjectSerialiserV1 serialiser = new ProjectSerialiserV1(fileController); FunctionInfo functionInfo = new FunctionInfo("Function", typeof(string), "Body", true, SyntaxEditorHelper.ScriptLanguageTypes.CSharp, "desc", "C#", "Gen"); functionInfo.Parameters.Add(new ParamInfo("varName", typeof(int)) { Modifiers = "static" }); StringBuilder sb = new StringBuilder(); XmlWriter writer = XmlWriter.Create(sb, new XmlWriterSettings { OmitXmlDeclaration = true }); serialiser.WriteFunctionXML(functionInfo, writer); writer.Close(); string output = XmlSqueezer.RemoveWhitespaceBetweenElements(sb.ToString()); Assert.That(output, Is.EqualTo(expectedXml)); }