first unit test
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using System.Xml.Serialization;
|
||||
using static System.Runtime.Serialization.Json.JsonReaderWriterFactory;
|
||||
|
||||
namespace Shapes
|
||||
{
|
||||
@@ -11,7 +7,7 @@ namespace Shapes
|
||||
{
|
||||
public void SaveShape(Stream stream, Shape shape)
|
||||
{
|
||||
DataContractJsonSerializer a = new DataContractJsonSerializer(typeof(Shape));
|
||||
var a = new DataContractJsonSerializer(typeof(Shape));
|
||||
a.WriteObject(stream, shape);
|
||||
// DataContractJsonSerializer j = new DataContractJsonSerializer(typeof(Shape));
|
||||
// j.WriteObject(stream, shape);
|
||||
@@ -20,8 +16,7 @@ namespace Shapes
|
||||
public T GetShapeFromFile<T>(Stream stream)
|
||||
{
|
||||
var a = new DataContractJsonSerializer(typeof(T));
|
||||
return (T) a.ReadObject(stream);
|
||||
return (T) a.ReadObject(stream);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user