I am trying to unit test
a simple function (compiles to a library) in c# VS 2012.
public static class Configuration
{
public static T DeSerialize<T>(string filePath)
{
if (!System.IO.File.Exists(filePath))
{
throw new System.IO.FileNotFoundException(filePath);
}
using (Stream reader = new FileStream(filePath, FileMode.Open))
{
var serializer = new System.Xml.Serialization.XmlSerializer(T);
return (T)serializer.Deserialize(reader);
}
}
}
[TestClass]
public class Test
{
[TestMethod]
public void deserializationTest()
{
var something = Configuration.DeSerialize<Item>(@"d:\CoffeeShop.Items.config");
Console.WriteLine(something);
}
}
But, I am stuck up with what to do next?
. What namespaces should I import
.
Any pointers is much appreciated.