public void Save(string fileName) { using (Stream stream = File.Create(fileName)) { SimulationSerializer.Save(stream, this); } }
public void SaveTest() { // arrange Simulation simulation; string expected; string actual; StringWriter writer; simulation = new Simulation(); expected = File.ReadAllText(this.GetDataFileName("default.sim")); writer = new StringWriter(); // act SimulationSerializer.Save(writer, simulation); // assert actual = writer.ToString(); // File.WriteAllText(@"D:\Checkout\trunk\cyotek\source\demo\ChemotaxisSimulation\tests\data\default.sim", actual); Assert.AreEqual(expected, actual); }