public void GetConnectionString_InvalidFile_FileNotFoundException() { var fullPath = DiskOnFile.CreatePhysicalFile(ODC_FILE, "NBi.Testing.Integration.Core.Resources." + ODC_FILE); var parser = new OfficeDataConnectionFileParser(Path.GetDirectoryName(fullPath) + Path.DirectorySeparatorChar); Assert.Throws <FileNotFoundException>(delegate { parser.GetConnectionString("NonExisting.odc"); }); }
public void GetConnectionString_ValidAbsoluteFile_CorrectConnectionString() { var fullPath = DiskOnFile.CreatePhysicalFile(ODC_FILE, "NBi.Testing.Integration.Core.Resources." + ODC_FILE); var parser = new OfficeDataConnectionFileParser(Path.GetDirectoryName(fullPath)); var connectionString = parser.GetConnectionString(fullPath); Assert.That(connectionString, Is.EqualTo("Provider=MSOLAP.7;Integrated Security=ClaimsToken;Identity Provider=AAD;Data Source=https://analysis.windows.net/powerbi/api;;Initial Catalog=sobe_wowvirtualserver-ccdf3d76-59d9-4e10-83e8-82eb0d27d1e9;Location=https://wabi-north-europe-redirect.analysis.windows.net/xmla?vs=sobe_wowvirtualserver&db=ccdf3d76-59d9-4e10-83e8-82eb0d27d1e9;MDX Compatibility= 1; MDX Missing Member Mode= Error; Safety Options= 2; Update Isolation Level= 2")); }