first unit test

This commit is contained in:
2019-10-25 03:16:17 -06:00
parent 6901925c69
commit 93b22ef2ec
21 changed files with 275 additions and 254 deletions

View File

@@ -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);
}
}
}