Beispiel #1
0
        public void NotEmptyDB_WriteSessionAndMetrics()
        {
            sut = new SessionWriter(fakeContext.Object,
                                    new DataReceiver(),
                                    new DataProvider(fakeContext.Object),
                                    new HierarchyWriter(fakeContext.Object),
                                    new MetricWriter(fakeContext.Object));

            sut.WriteSession();

            sut.WriteSession();

            Assert.That(fakeContext.Object.Sessions.Count, Is.EqualTo(2));
            Assert.That(fakeContext.Object.Containers.Count, Is.EqualTo(5));
            Assert.That(fakeContext.Object.Sensors.Count, Is.EqualTo(19));
            Assert.That(fakeContext.Object.Metrics.Count, Is.EqualTo(38));
        }
        public void GenerateFile()
        {
            // Get templates
            string templatePath = AssetDatabaseExt.GetAssetFilePath(TemplateFile);
            var    parser       = new TemplateParser(templatePath);

            parser.Parse();
            ITemplate template = parser.GetParsedTemplate();

            // Build session
            ISession session = BuildSession(template);

            // Write session to file
            Directory.CreateDirectory(OutputFolder);

            SessionWriter writer = new SessionWriter();

            writer.WriteSession(session, OutputPath);
            Debug.Log($"Menu script generated at '{OutputPath}'.");
        }