public void StateDirectory_Correct() { var sut = new LfMergeSettingsAccessor(); sut.Initialize(Path.GetTempPath()); Assert.That(sut.StateDirectory, Is.EqualTo(Path.Combine(Path.GetTempPath(), "state"))); }
public void FdoDirs_AbsolutePathsRemainAbsolute() { var sut = new LfMergeSettingsAccessor(); sut.Initialize(Path.GetTempPath(), "/projects", "/foo/templates"); Assert.That(sut.FdoDirectorySettings.ProjectsDirectory, Is.EqualTo("/projects")); Assert.That(sut.FdoDirectorySettings.DefaultProjectsDirectory, Is.EqualTo("/projects")); Assert.That(sut.FdoDirectorySettings.TemplateDirectory, Is.EqualTo("/foo/templates")); }
public void FdoDirs_RelativePathsAreSubdirsOfBasedir() { var sut = new LfMergeSettingsAccessor(); sut.Initialize(Path.GetTempPath(), "projects", "templates"); Assert.That(sut.FdoDirectorySettings.ProjectsDirectory, Is.EqualTo(Path.Combine(Path.GetTempPath(), "projects"))); Assert.That(sut.FdoDirectorySettings.DefaultProjectsDirectory, Is.EqualTo(Path.Combine(Path.GetTempPath(), "projects"))); Assert.That(sut.FdoDirectorySettings.TemplateDirectory, Is.EqualTo(Path.Combine(Path.GetTempPath(), "templates"))); }
public void GetQueueDirectory_Correct(QueueNames queue, string expectedDir) { // Setup using (var temp = new TemporaryFolder("QueueDirectory")) { var sut = new LfMergeSettingsAccessor(); sut.Initialize(temp.Path); // Exercise var queueDir = sut.GetQueueDirectory(queue); // Verify Assert.That(Path.GetFileName(queueDir), Is.EqualTo(expectedDir)); } }
public void GetStateFileName_Correct() { // Setup using (var temp = new TemporaryFolder("StateFile")) { var sut = new LfMergeSettingsAccessor(); sut.Initialize(temp.Path); // Exercise var stateFile = sut.GetStateFileName("ProjA"); // Verify Assert.That(stateFile, Is.EqualTo(Path.Combine(temp.Path, "state/ProjA.state"))); Assert.That(Directory.Exists(Path.GetDirectoryName(stateFile)), Is.True, "State directory didn't get created"); } }