public bool LoadUnitFromFile(string path) { try { UnitRegistry.IndexUnitByPath(path); return(true); } catch { return(false); } }
public void AddUnitByPath_UnitNotFound_True() { // Arrange UnitRegistry.UnitFiles.Clear(); UnitRegistry.Units.Clear(); // Act UnitRegistry.IndexUnitByPath($"{DirectoryName}/nonexistent-unit.service"); // Assert Assert.IsNull(UnitRegistry.GetUnit(TestUnitFilename)); }
public void AddUnitByPath_UnitFound_True() { // Arrange UnitRegistry.UnitFiles.Clear(); UnitRegistry.Units.Clear(); // Act UnitRegistry.IndexUnitByPath(TestUnitPath); // Assert Assert.IsNotNull(UnitRegistry.GetUnit(TestUnitFilename)); }