-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now showing "Results stats" in HTML output. Improved error handling a…
…nd message when PBI file is not supplied.
- Loading branch information
Showing
9 changed files
with
156 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleToAttribute("PBIXInspectorTests")] | ||
|
||
namespace PBIXInspectorLibrary | ||
{ | ||
internal class PbiFileUtils | ||
{ | ||
internal static PbiFile InitPbiFile(string pbiFilePath) | ||
{ | ||
if (string.IsNullOrEmpty(pbiFilePath)) throw new PBIXInspectorException("PBI file path is empty."); | ||
|
||
switch (PbiFile.PBIFileType(pbiFilePath)) | ||
{ | ||
case PbiFile.PBIFileTypeEnum.PBIX: | ||
return new PbixFile(pbiFilePath); | ||
case PbiFile.PBIFileTypeEnum.PBIP: | ||
return new PbipFile(pbiFilePath); | ||
case PbiFile.PBIFileTypeEnum.PBIPReport: | ||
return new PbipReportFile(pbiFilePath); | ||
default: | ||
throw new PBIXInspectorException(string.Format("Could not determine the extension of PBI file with path \"{0}\".", pbiFilePath)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma warning disable CS8602 | ||
|
||
using PBIXInspectorLibrary; | ||
|
||
namespace PBIXInspectorTests | ||
{ | ||
public class PbiFileUtilsTests | ||
{ | ||
[Test] | ||
public void PbiFileUtilsThrows() | ||
{ | ||
PbiFile pbiFile = null; | ||
string pbiFilePath = null; | ||
PBIXInspectorException ex = Assert.Throws<PBIXInspectorException>( | ||
() => pbiFile = PbiFileUtils.InitPbiFile(pbiFilePath)); | ||
} | ||
|
||
[Test] | ||
public void PbiFileUtilsThrows2() | ||
{ | ||
PbiFile pbiFile = null; | ||
string pbiFilePath = string.Empty; | ||
PBIXInspectorException ex = Assert.Throws<PBIXInspectorException>( | ||
() => pbiFile = PbiFileUtils.InitPbiFile(pbiFilePath)); | ||
} | ||
|
||
[Test] | ||
public void PbiFileUtilsThrows3() | ||
{ | ||
PbiFile pbiFile = null; | ||
string pbiFilePath = "myreport.xxxx"; | ||
PBIXInspectorException ex = Assert.Throws<PBIXInspectorException>( | ||
() => pbiFile = PbiFileUtils.InitPbiFile(pbiFilePath)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters