示例#1
0
        public async Task WriteAsync()
        {
            Simulation simulation = SimulationTestFactory.Make();

            var file = await XMLWriter.Write(simulation);

            Assert.IsTrue(file.Name.StartsWith(simulation.Name) && file.Name.EndsWith(Schrittmacher.App.SimulationFileExtension), "Exported file should have the title of the simulation as name, if there are  no conflicts. However existing files with the same name should not be replaced, but a unique name should be generated.");
        }
示例#2
0
        public async Task WriteAsync_NoDuplicates()
        {
            Simulation simulation = SimulationTestFactory.Make();

            var file = await XMLWriter.Write(simulation);

            var file2 = await XMLWriter.Write(simulation);

            Assert.AreEqual(file.Path, file2.Path, "Saving the same simulation should overwrite the file and not create duplicates.");
        }