Skip to content

Commit 06be7cc

Browse files
authored
Merge pull request #8 from ricaun-io/develop
Version 1.0.4
2 parents d3779b2 + 25660e0 commit 06be7cc

16 files changed

+248
-100
lines changed

CHANGELOG.md

Lines changed: 84 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,99 +4,115 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.4] / 2023-04-21
8+
### Updated
9+
- [x] Update `ricaun.NUnit` to 1.2.8 (`GetTestFullNames` get tests with *)
10+
### Fixed
11+
- [x] Fix Version Revit 2024 no Tests
12+
### Console
13+
- [x] Add Debug Tests in `RevitTestUtils`
14+
- [x] Update `RevitTestUtils` to min and max (2021-2023)
15+
### TestAdapter
16+
- [x] Add Metadata Discovery Tests
17+
- [x] Add `IsSimilarTestName` in `TestCaseUtils` (Make work with *)
18+
### Tests
19+
- [x] Add `TestRevitConstructor`
20+
- [x] Add `TestRevitOneTimeSetUp`
21+
722
## [1.0.3] / 2023-04-17
823
### Features
9-
[x] Update `TestAdapter` to work with '.' in the TestName. ('TestCaseUtils')
10-
[x] Update `RevitTest` to work with ',' and '\\' in the TestName.
24+
- [x] Update `TestAdapter` to work with '.' in the TestName. ('TestCaseUtils')
25+
- [x] Update `RevitTest` to work with ',' and '\\' in the TestName.
1126
### Application
12-
[x] Update `Tests` without Split(',')
27+
- [x] Update `Tests` without Split(',')
1328
### Console
14-
[x] Update Command `Test` to multiple parameters using `IEnumerable`.
29+
- [x] Update Command `Test` to multiple parameters using `IEnumerable`.
1530
### Shared
16-
[x] Add Info to `TestRequest`
17-
[x] Update `TestFilter` to `TestFilters` with `string[]`
31+
- [x] Add Info to `TestRequest`
32+
- [x] Update `TestFilter` to `TestFilters` with `string[]`
1833
### TestAdapter
19-
[x] Update `ProcessStart` to work with `IEnumerable` arguments, join with ' '.
20-
[x] Update `RevitTestProcessStart` to work filters `string[]`.
34+
- [x] Update `ProcessStart` to work with `IEnumerable` arguments, join with ' '.
35+
- [x] Update `RevitTestProcessStart` to work filters `string[]`.
2136

2237
## [1.0.2] / 2023-04-15
2338
### Features
24-
[x] Update `ricaun.NUnit` to 1.2.7
39+
- [x] Update `ricaun.NUnit` to 1.2.7
2540
### Tests
26-
[x] TestsCase - TestCase with string and null
41+
- [x] TestsCase - TestCase with string and null
2742
### Update
28-
[x] Update `TestAdapter` to work with `ricaun.NUnit` 1.2.7
29-
[x] Update `ProcessStart` in `TestAdapter` to work with `"` in the filter.
43+
- [x] Update `TestAdapter` to work with `ricaun.NUnit` 1.2.7
44+
- [x] Update `ProcessStart` in `TestAdapter` to work with `"` in the filter.
3045

3146
## [1.0.1] / 2023-04-11
3247
### Features
33-
[x] Update `ricaun.NUnit` to 1.2.6
48+
- [x] Update `ricaun.NUnit` to 1.2.6
3449
### Tests
35-
[x] TestRevit - Similar Parameter `(IDisposable is UIApplication)`
50+
- [x] TestRevit - Similar Parameter `(IDisposable is UIApplication)`
3651

3752
## [1.0.0] / 2023-02-27 - 2023-04-04
3853
### Features
3954
### Application
40-
[x] App - RibbonPanel/RibbonItem
41-
[x] PipeServer - Shared
42-
[x] UserUtils - IsValid/ISNotValid
43-
[x] PipeClient - PropertyChanged
44-
[x] Run Tests - ricaun.NUnit
45-
[x] Run Tests - Filter Tests
46-
[x] Zip - Copy Zip Folder
47-
[x] Zip - Copy back Zip Folder
48-
[] Zip - Zip max size file
49-
[x] Log - Debug/Jornal
50-
[x] Log - FileOpen/JornalOpen
55+
- [x] App - RibbonPanel/RibbonItem
56+
- [x] PipeServer - Shared
57+
- [x] UserUtils - IsValid/ISNotValid
58+
- [x] PipeClient - PropertyChanged
59+
- [x] Run Tests - ricaun.NUnit
60+
- [x] Run Tests - Filter Tests
61+
- [x] Zip - Copy Zip Folder
62+
- [x] Zip - Copy back Zip Folder
63+
- [] Zip - Zip max size file
64+
- [x] Log - Debug/Jornal
65+
- [x] Log - FileOpen/JornalOpen
5166
### Console
52-
[x] Info - icon.ico
53-
[x] PipeClient - Shared
54-
[x] PipeClient - PropertyChanged
55-
[x] RevitInstallation - Get Revit Installed
56-
[x] CommandLine - Run File Tests
57-
[x] CommandLine - Get File Tests FullName
58-
[x] CommandLine - Output to Console/File
59-
[x] CommandLine - Logger enable/disable
60-
[x] CommandLine - Select RevitVersion
61-
[x] CommandLine - Force Open/Close/Wait
62-
[x] CommandLine - Run Tests with Filter
63-
[x] CommandLine - DebuggerAttach hidden options (DebuggerUtils with EnvDTE)
64-
[x] CommandLine - Update Parser (Ignore Unknown Arguments)
67+
- [x] Info - icon.ico
68+
- [x] PipeClient - Shared
69+
- [x] PipeClient - PropertyChanged
70+
- [x] RevitInstallation - Get Revit Installed
71+
- [x] CommandLine - Run File Tests
72+
- [x] CommandLine - Get File Tests FullName
73+
- [x] CommandLine - Output to Console/File
74+
- [x] CommandLine - Logger enable/disable
75+
- [x] CommandLine - Select RevitVersion
76+
- [x] CommandLine - Force Open/Close/Wait
77+
- [x] CommandLine - Run Tests with Filter
78+
- [x] CommandLine - DebuggerAttach hidden options (DebuggerUtils with EnvDTE)
79+
- [x] CommandLine - Update Parser (Ignore Unknown Arguments)
6580
### Shared
66-
[x] PipeServer/Client - Json
67-
[x] PipeServer/Client - Default is new()
68-
[x] PipeServer/Client - Mapper.Map (Update Map static)
69-
[x] TestRequests - PropertyChanged
70-
[x] TestResponse - PropertyChanged
71-
[x] TestResponse - Test/Tests/Info
72-
[x] Fody.PropertyChanged
81+
- [x] PipeServer/Client - Json
82+
- [x] PipeServer/Client - Default is new()
83+
- [x] PipeServer/Client - Mapper.Map (Update Map static)
84+
- [x] TestRequests - PropertyChanged
85+
- [x] TestResponse - PropertyChanged
86+
- [x] TestResponse - Test/Tests/Info
87+
- [x] Fody.PropertyChanged
7388
### TestAdapter
74-
[x] TestAdapter - Discoverer
75-
[x] TestAdapter - Executor
76-
[x] TestAdapter - Logger (AdapterLogger)
77-
[x] TestAdapter - TestCaseUtils
78-
[x] TestAdapter - RunSettings (AdapterSettings, XmlExtension, RunSettingModel, XmlBool)
79-
[x] TestAdapter - RunSettingsModel (Version, Open, Close, Verbosity, Application, Metadata)
80-
[x] TestAdapter - Custom Application Process (Download Zip)
81-
[x] TestAdapter - Add Debugger in executor if needed
82-
[X] TestAdapter - MetadataMapper (AssemblyMetadataAttribute)
83-
[x] Services - RevitTestConsole
84-
[x] Services - ProcessStart
85-
[x] Services - RevitTestProcessStart
86-
[x] Services - ApplicationUtils
87-
[x] Test Models
88-
[x] Package - Icon
89+
- [x] TestAdapter - Discoverer
90+
- [x] TestAdapter - Executor
91+
- [x] TestAdapter - Logger (AdapterLogger)
92+
- [x] TestAdapter - TestCaseUtils
93+
- [x] TestAdapter - RunSettings (AdapterSettings, XmlExtension, RunSettingModel, XmlBool)
94+
- [x] TestAdapter - RunSettingsModel (Version, Open, Close, Verbosity, Application, Metadata)
95+
- [x] TestAdapter - Custom Application Process (Download Zip)
96+
- [x] TestAdapter - Add Debugger in executor if needed
97+
- [X] TestAdapter - MetadataMapper (AssemblyMetadataAttribute)
98+
- [x] Services - RevitTestConsole
99+
- [x] Services - ProcessStart
100+
- [x] Services - RevitTestProcessStart
101+
- [x] Services - ApplicationUtils
102+
- [x] Test Models
103+
- [x] Package - Icon
89104
### Tests
90-
[x] TestsRevit
91-
[x] TestsRevitDocument
92-
[x] TestsDebugger
93-
[x] TestsFile
94-
[x] TestsFolder
95-
[x] TestsPass
96-
[x] TestsIgnore
97-
[x] TestsFail
105+
- [x] TestsRevit
106+
- [x] TestsRevitDocument
107+
- [x] TestsDebugger
108+
- [x] TestsFile
109+
- [x] TestsFolder
110+
- [x] TestsPass
111+
- [x] TestsIgnore
112+
- [x] TestsFail
98113

99114
[vNext]: ../../compare/1.0.0...HEAD
115+
[1.0.4]: ../../compare/1.0.3...1.0.4
100116
[1.0.3]: ../../compare/1.0.2...1.0.3
101117
[1.0.2]: ../../compare/1.0.1...1.0.2
102118
[1.0.1]: ../../compare/1.0.0...1.0.1

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.3</Version>
3+
<Version>1.0.4</Version>
44
</PropertyGroup>
55
</Project>
101 Bytes
Binary file not shown.

ricaun.RevitTest.Console/Utils/RevitTestUtils.cs

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
using ricaun.RevitTest.Console.Extensions;
44
using ricaun.RevitTest.Shared;
55
using System;
6+
using System.Collections.Generic;
67
using System.Diagnostics;
78
using System.IO;
9+
using System.Linq;
810
using System.Threading;
911

1012
namespace ricaun.RevitTest.Console.Utils
1113
{
14+
/// <summary>
15+
/// RevitTestUtils
16+
/// </summary>
1217
public static class RevitTestUtils
1318
{
19+
private const int RevitMinVersionReference = 2021;
20+
private const int RevitMaxVersionReference = 2023;
21+
1422
/// <summary>
1523
/// Get Test Full Names using RevitInstallation if needed (Revit +2021)
1624
/// </summary>
@@ -22,20 +30,49 @@ public static string[] GetTestFullNames(string filePath)
2230
if (RevitUtils.TryGetRevitVersion(filePath, out var revitVersion))
2331
{
2432
Log.WriteLine($"RevitTestUtils: {revitVersion}");
25-
if (tests.Length == 0)
33+
LoggerTest($"RevitTestUtils: {revitVersion}");
34+
35+
// Problem with AnavRes.dll / adui22res.dll (version -2020)
36+
// Problem with UI (version 2024)
37+
var revitVersionMinMax = Math.Min(Math.Max(revitVersion, RevitMinVersionReference), RevitMaxVersionReference);
38+
if (RevitInstallationUtils.InstalledRevit.TryGetRevitInstallationGreater(revitVersionMinMax, out RevitInstallation revitInstallationMinMax))
2639
{
27-
// Problem with AnavRes.dll / adui22res.dll (version -2020)
28-
revitVersion = Math.Max(revitVersion, 2021);
29-
if (RevitInstallationUtils.InstalledRevit.TryGetRevitInstallationGreater(revitVersion, out RevitInstallation revitInstallation))
30-
{
31-
Log.WriteLine($"RevitTestUtils: {revitInstallation.InstallLocation}");
32-
tests = TestEngine.GetTestFullNames(filePath, revitInstallation.InstallLocation);
33-
}
40+
LoggerTest($"GetTest Version {revitVersionMinMax}");
41+
Log.WriteLine($"RevitTestUtils: {revitInstallationMinMax.InstallLocation}");
42+
tests = TestEngine.GetTestFullNames(filePath, revitInstallationMinMax.InstallLocation);
3443
}
44+
else if (RevitInstallationUtils.InstalledRevit.TryGetRevitInstallationGreater(revitVersion, out RevitInstallation revitInstallation))
45+
{
46+
LoggerTest($"GetTest Version {revitVersion}");
47+
Log.WriteLine($"RevitTestUtils: {revitInstallation.InstallLocation}");
48+
tests = TestEngine.GetTestFullNames(filePath, revitInstallation.InstallLocation);
49+
}
50+
}
51+
52+
#if DEBUG
53+
LoggerTest($"Length {tests.Length}");
54+
LoggerTest($"TestEngine {TestEngine.Version.ToString(3)}");
55+
if (LoggerTests.Any())
56+
{
57+
LoggerTests.AddRange(tests);
58+
return LoggerTests.ToArray();
3559
}
60+
#endif
61+
3662
return tests;
3763
}
3864

65+
#region Debug
66+
private static List<string> LoggerTests = new List<string>();
67+
[Conditional("DEBUG")]
68+
private static void LoggerTest(object logger)
69+
{
70+
var loggerTest = $"{typeof(RevitTestUtils).FullName}(\"{logger}\")";
71+
Debug.WriteLine(loggerTest);
72+
LoggerTests.Add(loggerTest);
73+
}
74+
#endregion
75+
3976
/// <summary>
4077
/// Create Revit Server
4178
/// </summary>

ricaun.RevitTest.Console/ricaun.RevitTest.Console.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
<DebugType>Full</DebugType>
2626
</PropertyGroup>
2727

28-
<!-- Debug -->
29-
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
30-
<Version>0.0.0</Version>
31-
</PropertyGroup>
32-
3328
<PropertyGroup>
3429
<Company>ricaun</Company>
3530
<Authors>Luiz Henrique Cassettari</Authors>

ricaun.RevitTest.TestAdapter/AdapterLogger.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ public static void Create(IMessageLogger messageLogger, int verbosity = 0)
2020
{
2121
Instance = new AdapterLogger();
2222
Instance.Initialize(messageLogger);
23+
SetVerbosity(verbosity);
24+
}
25+
}
26+
27+
public static void SetVerbosity(int verbosity = 0)
28+
{
29+
if (Instance != null)
30+
{
2331
Instance.TestLogger.Verbosity = verbosity;
2432
}
2533
}

ricaun.RevitTest.TestAdapter/Metadatas/MetadataMapper.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private static bool IsPropertyInfoEqualAttribute(AssemblyMetadataAttribute attri
2626
}
2727
private static object GetValue(AssemblyMetadataAttribute attribute, PropertyInfo propertyInfo)
2828
{
29-
Debug.WriteLine(propertyInfo.PropertyType);
3029
var type = propertyInfo.PropertyType;
3130
if (type == typeof(int))
3231
{

ricaun.RevitTest.TestAdapter/Metadatas/MetadataSettings.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@ public static void Create(string source)
3131

3232
//Mapper.Map(metadataRunSettings.DeserializeXml<RunSettingsModel>(), AdapterSettings.Settings);
3333

34-
if (assemblyMetadataAttributes.Any())
34+
if (assemblyMetadataAttributes.Any(e => e.Key.StartsWith(nameof(AdapterSettings.Settings.NUnit))))
3535
{
3636
MetadataMapper.Map(assemblyMetadataAttributes, AdapterSettings.Settings.NUnit);
37+
AdapterLogger.SetVerbosity(AdapterSettings.Settings.NUnit.Verbosity);
3738
AdapterLogger.Logger.Info($"AdapterSettings: {AdapterSettings.Settings}");
3839
}
3940
}
40-
catch { }
41+
catch (Exception ex)
42+
{
43+
AdapterLogger.Logger.Info($"Metadata: {ex}", 0);
44+
}
4145
}
4246
}
4347
}
512 Bytes
Binary file not shown.

ricaun.RevitTest.TestAdapter/TestCaseUtils.cs

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,43 @@ namespace ricaun.RevitTest.TestAdapter
44
{
55
public static class TestCaseUtils
66
{
7+
public static bool IsSimilarTestName(TestCase testCase, string testName, bool onlyFullyQualifiedName = false)
8+
{
9+
SplitTestName(testName, out string fullyQualifiedName, out string displayName);
10+
11+
if (onlyFullyQualifiedName)
12+
return testCase.FullyQualifiedName == fullyQualifiedName;
13+
14+
return testCase.FullyQualifiedName == fullyQualifiedName && testCase.DisplayName == displayName;
15+
}
16+
717
public static string GetFullName(TestCase testCase)
818
{
919
return $"{testCase.FullyQualifiedName}.{testCase.DisplayName}";
1020
}
21+
1122
public static TestCase Create(string source, string testName)
1223
{
13-
var indexOf = LastIndexOfDisplayName(testName);
14-
var fullyQualifiedName = testName.Substring(0, indexOf);
15-
var displayName = testName.Substring(indexOf + 1);
24+
SplitTestName(testName, out string fullyQualifiedName, out string displayName);
1625

1726
var testCase = new TestCase(fullyQualifiedName, TestAdapter.ExecutorUri, source)
1827
{
1928
DisplayName = displayName,
20-
Id = GetGuid($"{testName}"),
29+
Id = GetGuid(testName),
2130
};
2231

2332
return testCase;
2433
}
2534

35+
#region private
36+
37+
private static void SplitTestName(string testName, out string fullyQualifiedName, out string displayName)
38+
{
39+
var indexOf = LastIndexOfDisplayName(testName);
40+
fullyQualifiedName = testName.Substring(0, indexOf);
41+
displayName = testName.Substring(indexOf + 1);
42+
}
43+
2644
private static int LastIndexOfDisplayName(string testName)
2745
{
2846
var lastIndexOfDot = testName.LastIndexOf('.');
@@ -35,9 +53,11 @@ private static int LastIndexOfDisplayName(string testName)
3553
return lastIndexOfDot;
3654
}
3755

38-
private static System.Guid GetGuid(string name)
56+
private static System.Guid GetGuid(string testName)
3957
{
40-
return new System.Guid(name.GetHashCode(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
58+
return new System.Guid(testName.GetHashCode(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
4159
}
60+
61+
#endregion
4262
}
4363
}

0 commit comments

Comments
 (0)