Skip to content

Commit e12cbaa

Browse files
author
a.vorobiev
committed
Fix unit tests and installer
1 parent 8e8f2aa commit e12cbaa

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

CDP4Composition/Modularity/PluginLoader.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,18 @@ private void LoadPlugins(string path)
136136

137137
this.logger.Info($"Loading plugin files from path {path}: {string.Join("; ", dllCatalog.LoadedFiles.Select(p => new FileInfo(p).Name))}");
138138

139-
foreach (var composablePartDefinition in dllCatalog.Parts)
139+
try
140140
{
141-
this.logger.Info($"Imported part {composablePartDefinition}");
141+
// try catch block as unit tests can throw an exception due to not all assemblies being preloaded.
142+
// This is expected behavior
143+
foreach (var composablePartDefinition in dllCatalog.Parts)
144+
{
145+
this.logger.Info($"Imported part {composablePartDefinition}");
146+
}
147+
}
148+
catch (Exception ex)
149+
{
150+
this.logger.Error($"Parts catalog unavailable due to missing assembly. Error: {ex.Message}");
142151
}
143152

144153
this.DirectoryCatalogues.Add(dllCatalog);

CDP4IME.Tests/ShellViewModelTestFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void VerifyThatArgumentNullExceptionIsThrown()
145145
[Test]
146146
public void VerifyThatTheCaptionIsCorrect()
147147
{
148-
var title = "COMET IME - Community Edition";
148+
var title = "COMET IME - Community Edition";
149149
Assert.AreEqual(title, this.viewModel.Title);
150150
}
151151

CDP4IME/ShellViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public ShellViewModel(IDialogNavigationService dialogNavigationService, DockLayo
150150

151151
this.dialogNavigationService = dialogNavigationService;
152152
this.DockViewModel = dockViewModel;
153-
this.Title = $"COMET IME {Assembly.GetEntryAssembly().GetName().Version} - Community Edition";
153+
this.Title = $"COMET IME {Assembly.GetEntryAssembly()?.GetName().Version} - Community Edition";
154154

155155
this.logTarget = new MemoryEventTarget();
156156
this.logTarget.EventReceived += this.LogEventReceived;
@@ -218,7 +218,7 @@ public ShellViewModel(IDialogNavigationService dialogNavigationService, DockLayo
218218

219219
this.OnClosingCommand = ReactiveCommand.CreateAsyncTask(async x => this.OnClosing(x as CancelEventArgs), RxApp.MainThreadScheduler);
220220

221-
logger.Info($"Welcome in the COMET IME version {Assembly.GetEntryAssembly().GetName().Version}");
221+
logger.Info($"Welcome in the COMET IME version {Assembly.GetEntryAssembly()?.GetName().Version}");
222222
logger.Info($"IME Shell Initialized");
223223
}
224224

CDP4IMEInstaller/Product.wxs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
33

44
<Product Id="*" Name="COMET-CE" Language="1033" Version="10.0.1.1" Manufacturer="RHEA System S.A." UpgradeCode="83b3da1e-4a38-40f0-b2a6-5f58b32238a4">
5-
<Product Id="*" Name="COMET-CE" Language="1033" Version="9.0.2.0" Manufacturer="RHEA System S.A." UpgradeCode="83b3da1e-4a38-40f0-b2a6-5f58b32238a4">
6-
75
<?include variables.wxi ?>
86

97
<Package InstallPrivileges="elevated"

0 commit comments

Comments
 (0)