public void MissingDirectory() { using var tempDir = TempDir.Create(); using var wd = WorkingDirectory.ChangeTo(tempDir); var dataProvider = new DataProvider(); Assert.That(dataProvider.FindDefaultDataSources(), Is.Empty); }
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); }
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); }
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), })); }