Beispiel #1
0
        public void ParsesDataFromFile()
        {
            var dataBefore = new ExportedData
            {
                BaseBu     = Guid.NewGuid(),
                RecordSets = new List <ExportEntity>
                {
                    new ExportEntity {
                        Id = Guid.NewGuid()
                    },
                    new ExportEntity {
                        Id = Guid.NewGuid()
                    },
                    new ExportEntity {
                        Id = Guid.NewGuid()
                    }
                }
            };

            DataWriterService.WriteDataToFile(dataBefore, WorkingDirectory);

            var dataAfter = DataReaderService.ParseDataFromFile(WorkingDirectory);

            Assert.AreEqual(3, dataAfter.RecordSets.Count);
        }
        public void WritesDataToFile()
        {
            Assert.IsFalse(FileManager.FileSystem.File.Exists(@"C:\ExportedData\ExportedData.json"));

            var exportedData = new ExportedData();

            exportedData.RecordSets = new List <ExportEntity>
            {
                new ExportEntity
                {
                    Id = Guid.NewGuid()
                }
            };

            DataWriterService.WriteDataToFile(exportedData, @"C:\ExportedData\");

            Assert.IsTrue(FileManager.FileSystem.File.Exists(@"C:\ExportedData\ExportedData.json"));
        }