public void CheckPathsNotUsedInOtherInstances_ShouldSuceed() { var newInstance = new ServiceControlInstanceMetadata { InstallPath = @"c:\test\2\bin", LogPath = @"c:\test\2\logs", DBPath = @"c:\test\2\db" }; var p = new PathsValidator(newInstance) { Instances = instances }; Assert.DoesNotThrow(() => p.CheckPathsNotUsedInOtherInstances()); }
public void CheckPathsNotUsedInOtherInstances_ShouldThrow() { var newInstance = new ServiceControlInstanceMetadata { InstallPath = @"c:\test\1\bin", //This one is bad LogPath = @"c:\test\2\logs", DBPath = @"c:\test\2\db" }; var p = new PathsValidator(newInstance) { Instances = instances }; var ex = Assert.Throws <EngineValidationException>(() => p.CheckPathsNotUsedInOtherInstances()); Assert.That(ex.Message, Is.EqualTo("The install path specified is already assigned to another instance")); }