コード例 #1
0
            public void MissingDirectory()
            {
                using var tempDir = TempDir.Create();
                using var wd      = WorkingDirectory.ChangeTo(tempDir);
                var dataProvider = new DataProvider();

                Assert.That(dataProvider.FindDefaultDataSources(), Is.Empty);
            }
コード例 #2
0
            public void EmptyDirectory()
            {
                using var tempDir = TempDir.Create();
                using var wd      = WorkingDirectory.ChangeTo(tempDir);
                var dataProvider = new DataProvider();

                var iecCddPath = Path.Combine(tempDir, "iec-cdd");

                Directory.CreateDirectory(iecCddPath);

                Assert.That(dataProvider.FindDefaultDataSources(), Is.Empty);
            }
コード例 #3
0
            public void IncompleteSource()
            {
                using var tempDir = TempDir.Create();
                using var wd      = WorkingDirectory.ChangeTo(tempDir);
                var dataProvider = new DataProvider();

                var iecCddPath = Path.Combine(tempDir, "iec-cdd");

                Directory.CreateDirectory(iecCddPath);

                using var source = TempDir.Create(iecCddPath);
                CreateEmptyXls(source, GetExportFileName("class", "12345"));

                Assert.That(dataProvider.FindDefaultDataSources(), Is.Empty);
            }
コード例 #4
0
            public void ValidSource()
            {
                using var tempDir = TempDir.Create();
                using var wd      = WorkingDirectory.ChangeTo(tempDir);
                var dataProvider = new DataProvider();

                var iecCddPath = Path.Combine(tempDir, "iec-cdd");

                Directory.CreateDirectory(iecCddPath);

                using var source = TempDir.Create(iecCddPath);
                CreateEmptyXls(source, GetExportFileName("class", "12345"));
                CreateEmptyXls(source, GetExportFileName("property", "12345"));

                Assert.That(dataProvider.FindDefaultDataSources(), Is.EquivalentTo(new[] {
                    new DataSource(dataProvider, source, Model.DataSourceType.Default),
                }));
            }