Last active
August 29, 2015 14:02
-
-
Save foyzulkarim/ffc3bb25c0352ae41f5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace XmlParserLibrary | |
{ | |
public class MyXmlParser | |
{ | |
public string GetValue(string node) | |
{ | |
String s = ""; | |
if (node.StartsWith("<xml>") && node.EndsWith("</xml>")) | |
{ | |
s = node.Split(new[] {"<xml>"},StringSplitOptions.None)[1].Split(new []{"</xml>"}, | |
StringSplitOptions.None)[0]; | |
} | |
return s; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace XmlParserLibraryTestProject | |
{ | |
[TestClass] | |
public class MyXmlParserTest | |
{ | |
[TestMethod] | |
public void testGetValue() | |
{ | |
MyXmlParser class1 = new MyXmlParser(); | |
String value = class1.GetValue("<xml>test</xml>"); | |
Assert.AreEqual("test",value,"Failed"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment