Skip to content

Commit

Permalink
Update ApplicationUtils check local file exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Aug 28, 2024
1 parent 3fb9ec6 commit 437e4c7
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix local file copy to temporary by zip folder.
- Add `TestsFilePathTooLong` to similate long path inside test.
- Update to use `ricaun.Revit.UI.Tasks` library to run async tests.
- Update `ApplicationUtils` check local file exists.

## [1.3.4] / 2024-05-27
### Console
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.3.5-rc</Version>
<Version>1.3.5-rc.1</Version>
</PropertyGroup>
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion ricaun.RevitTest.TestAdapter/Services/ApplicationUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ public static async Task<bool> DownloadAsync(string applicationFolder, string ad
private static bool LocalFileExists(string filePath, out string localFilePath)
{
localFilePath = filePath;
if (File.Exists(localFilePath)) return true;
try
{
var assemblyDirectory = Path.GetDirectoryName(typeof(ApplicationUtils).Assembly.Location);
localFilePath = Path.Combine(assemblyDirectory, filePath);
localFilePath = new FileInfo(localFilePath).FullName;
AdapterLogger.Logger.Debug($"Application LocalFileCheck: {assemblyDirectory}");
if (File.Exists(localFilePath))
{
AdapterLogger.Logger.DebugOnlyLocal($"Download File AssemblyDirectory: {assemblyDirectory}");
Expand Down
18 changes: 10 additions & 8 deletions ricaun.RevitTest.Tests/TestsDebugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@

//[assembly: AssemblyMetadata("NUnit.Verbosity", "3")]

[assembly: AssemblyMetadata("NUnit.Application", "RICAUN_REVIT_TEST_APPLICATION_DA4R_LOCAL")]
[assembly: AssemblyMetadata("NUnit.Application", "NUNIT_APPLICATION_TEST")]
[assembly: AssemblyMetadata("NUnit.Application", "RICAUN_REVIT_TEST_APPLICATION_DA4R_ONLINE_TEST")]
#if NET
[assembly: AssemblyMetadata("NUnit.Application", "..\\..\\..\\..\\ricaun.RevitTest.Console\\bin\\Debug\\net8.0-windows\\ricaun.RevitTest.Console.exe")]
#else
[assembly: AssemblyMetadata("NUnit.Application", "..\\..\\..\\..\\ricaun.RevitTest.Console\\bin\\Debug\\net48\\ricaun.RevitTest.Console.exe")]
#endif
//[assembly: AssemblyMetadata("NUnit.Application", "RICAUN_REVIT_TEST_APPLICATION_DA4R_LOCAL")]
//[assembly: AssemblyMetadata("NUnit.Application", "NUNIT_APPLICATION_TEST")]
//[assembly: AssemblyMetadata("NUnit.Application", "RICAUN_REVIT_TEST_APPLICATION_DA4R_ONLINE_TEST")]
//#if NET
//[assembly: AssemblyMetadata("NUnit.Application", "..\\..\\..\\..\\ricaun.RevitTest.Console\\bin\\Debug\\net8.0-windows\\ricaun.RevitTest.Console.exe")]
//#else
//[assembly: AssemblyMetadata("NUnit.Application", "..\\..\\..\\..\\ricaun.RevitTest.Console\\bin\\Debug\\net48\\ricaun.RevitTest.Console.exe")]
//#endif

[assembly: AssemblyMetadata("NUnit.Application", "..\\..\\..\\..\\ricaun.RevitTest.Console\\bin\\Debug\\ricaun.DA4R.NUnit.Console.zip")]

//[assembly: AssemblyMetadata("NUnit.Language", "ENU /hosted")]
#endif
Expand Down

0 comments on commit 437e4c7

Please sign in to comment.