Did a lot of work just unit testing left

This commit is contained in:
2019-10-25 02:30:49 -06:00
parent 8d6ba5df72
commit 6901925c69
15 changed files with 508 additions and 74 deletions

27
Shapes/FileIO.cs Normal file
View File

@@ -0,0 +1,27 @@
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
{
public class FileIO
{
public void SaveShape(Stream stream, Shape shape)
{
DataContractJsonSerializer a = new DataContractJsonSerializer(typeof(Shape));
a.WriteObject(stream, shape);
// DataContractJsonSerializer j = new DataContractJsonSerializer(typeof(Shape));
// j.WriteObject(stream, shape);
}
public T GetShapeFromFile<T>(Stream stream)
{
var a = new DataContractJsonSerializer(typeof(T));
return (T) a.ReadObject(stream);
}
}
}