public void CopyAsText() { STLDocument stlStringFrom = null; STLDocument stlStringTo = null; STLDocument stlBinaryFrom = null; STLDocument stlBinaryTo = null; using (Stream inStream = GetData("ASCII.stl"), outStream = new MemoryStream()) { stlStringFrom = STLDocument.Read(inStream); stlStringTo = STLDocument.CopyAsText(inStream, outStream); } Assert.IsNotNull(stlStringFrom); Assert.IsNotNull(stlStringTo); Assert.IsTrue(stlStringFrom.Equals(stlStringTo)); using (Stream inStream = GetData("Binary.stl"), outStream = new MemoryStream()) { stlBinaryFrom = STLDocument.Read(inStream); stlBinaryTo = STLDocument.CopyAsText(inStream, outStream); } Assert.IsNotNull(stlBinaryFrom); Assert.IsNotNull(stlBinaryTo); Assert.IsTrue(stlBinaryFrom.Equals(stlBinaryTo)); }
public void CopyAsText() { STLDocument stlStringFrom; STLDocument stlStringTo; STLDocument stlBinaryFrom; STLDocument stlBinaryTo; using (var inStream = GetData("ASCII.stl")) using (var outStream = new MemoryStream()) { stlStringFrom = STLDocument.Read(inStream); stlStringTo = STLDocument.CopyAsText(inStream, outStream); } Assert.NotNull(stlStringFrom); Assert.NotNull(stlStringTo); Assert.Equal(stlStringFrom, stlStringTo); using (var inStream = GetData("Binary.stl")) using (var outStream = new MemoryStream()) { stlBinaryFrom = STLDocument.Read(inStream); stlBinaryTo = STLDocument.CopyAsText(inStream, outStream); } Assert.NotNull(stlBinaryFrom); Assert.NotNull(stlBinaryTo); Assert.Equal(stlBinaryFrom, stlBinaryTo); }