Skip to content

Commit

Permalink
Bug fix: the main window was not automatically opened on the first st…
Browse files Browse the repository at this point in the history
…art.

Clean up setup script.
  • Loading branch information
rguida committed May 20, 2024
1 parent a09ee2c commit bef3c84
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2

# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test

# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
Expand Down
5 changes: 4 additions & 1 deletion MMExNotifier.Tests/MainViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@ public void Setup()
}

[Test]
public void WhenDatabasePathIsNotConfigured_ShouldNotAttemptOpenDatabase()
public void WhenDatabasePathIsNotConfigured_ShouldRaiseOpen()
{
mockAppConfiguration.Setup(x => x.MMExDatabasePath).Returns(string.Empty);
mockDatabaseService.Setup(x => x.ExpiringBills).Returns(() => null);

var mainViewModel = new MainViewModel(mockAppConfiguration.Object, mockNotificationService.Object, mockDatabaseService.Object);
var openInvoked = false;
mainViewModel.OnOpen += (s, e) => { openInvoked = true; };
mainViewModel.Activate();

Assert.That(mockDatabaseService.Invocations, Is.Empty);
Assert.That(openInvoked, Is.True);
}

[Test]
Expand Down
6 changes: 1 addition & 5 deletions MMExNotifier/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ Name: "{app}\runtimes"

[Files]
Source: "{#FindFolder("bin\Release\net6.0-*")}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\EntityFramework.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\EntityFramework.SqlServer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\Hardcodet.NotifyIcon.Wpf.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\linq2db.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\Microsoft.Toolkit.Uwp.Notifications.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\Microsoft.Win32.TaskScheduler.dll"; DestDir: "{app}"; Flags: ignoreversion
Expand All @@ -57,10 +54,9 @@ Source: "{#FindFolder("bin\Release\net6.0-*")}\MMExNotifier.dll"; DestDir: "{app
Source: "{#FindFolder("bin\Release\net6.0-*")}\MMExNotifier.dll.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\MMExNotifier.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\MMExNotifier.runtimeconfig.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\System.Data.SqlClient.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\System.Data.SQLite.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\System.Data.SQLite.EF6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\WinRT.Runtime.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\Wpf.Ui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#FindFolder("bin\Release\net6.0-*")}\runtimes\*"; DestDir: "{app}\runtimes"; Flags: recursesubdirs
Source: "LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Expand Down
3 changes: 3 additions & 0 deletions MMExNotifier/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ public MainViewModel(IAppConfiguration appSettings, INotificationService notific
public override void Activate()
{
if (string.IsNullOrEmpty(AppSettings.MMExDatabasePath))
{
Open();
return;
}

LoadExpiringBills();

Expand Down

0 comments on commit bef3c84

Please sign in to comment.