mercredi 1 juillet 2015

Json is not working in unit test class

I am not able to run and debug the test function when I write the following code into test function.

StreamReader sr = new StreamReader(@"E:\Projects\AutoFlow\trunk\AutoFlow.Tests\json1.json");
JsonSerializer ser = new JsonSerializer();
WorkQueueTaskType obj = ser.Deserialize<WorkQueueTaskType>(new JsonTextReader(sr));
obj.entityState = ObjectState.Added;
new WorkQueueTaskTypeManager().Add(obj);

Please let me know what is the reason behind this.

Aucun commentaire:

Enregistrer un commentaire