Skip to content

Commit

Permalink
🚧Fix app service path resolution (#1082)
Browse files Browse the repository at this point in the history
* Start work for issue #1081

* config: update git ignore

* fix: adjust how the application path is constructed

* refactor: adjust string values

* ide: add words to dictionary
  • Loading branch information
CalvinWilkinson authored Feb 6, 2025
1 parent 7da7bdf commit f820d2c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ mono_crash.*
[Aa][Rr][Mm]64/
bld/

# Disabled so we can commit the dev-tools/bin installation dir
Testing/**/[Bb]in/
Performance/**/[Bb]in/

[Oo]bj/
[Ll]og/
Expand Down
4 changes: 2 additions & 2 deletions Testing/VelaptorTesting/Scenes/AudioScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void CreateAudioCtrls()
audioList.Label = "Audio File";

audioList.Items.Add("Ridley Draygon Theme (OGG)");
audioList.Items.Add("Ridleys Hideout (MP3)");
audioList.Items.Add("Ridley's Hideout (MP3)");
audioList.Items.Add("Mother Brain Final Battle (OGG)");
audioList.SelectedItemIndexChanged += (_, i) =>
{
Expand All @@ -196,7 +196,7 @@ private void CreateAudioCtrls()
var audioName = chosenItem switch
{
"Ridley Draygon Theme (OGG)" => "ridley-draygon-theme.ogg",
"Ridleys Hideout (MP3)" => "ridleys-hideout.mp3",
"Ridley's Hideout (MP3)" => "ridleys-hideout.mp3",
"Mother Brain Final Battle (OGG)" => "mother-brain-final-battle.ogg",
_ => throw new ArgumentException($"The audio item '{chosenItem}' is not supported."),
};
Expand Down
4 changes: 4 additions & 0 deletions Velaptor.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private $OBJECT_TYPE$ CreateSystemUnderTest()
<s:Boolean x:Key="/Default/UserDictionary/Words/=csharpsquid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ctrls/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=dfactor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=draygon/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=esvau/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=filepathname/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Hori/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -148,6 +149,9 @@ private $OBJECT_TYPE$ CreateSystemUnderTest()
<s:Boolean x:Key="/Default/UserDictionary/Words/=pname/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reactable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reactables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ridley/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ridleys/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ridley_0027s/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=samus/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sfactor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=texels/@EntryIndexedValue">True</s:Boolean>
Expand Down
14 changes: 7 additions & 7 deletions Velaptor/Services/AppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@

namespace Velaptor.Services;

using System;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;

/// <inheritdoc/>
[ExcludeFromCodeCoverage(Justification = "No implementation to test")]
internal class AppService : IAppService
{
private readonly string appDirectory = string.Empty;
private bool alreadyInitialized;

/// <summary>
/// Initializes a new instance of the <see cref="AppService"/> class.
/// </summary>
public AppService() => AppDirectory = AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar);

/// <inheritdoc/>
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "No tests written for this.")]
public string AppDirectory => string.IsNullOrEmpty(this.appDirectory)
? Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty
: this.appDirectory;
public string AppDirectory { get; }

/// <inheritdoc/>
[SuppressMessage("ReSharper", "UnusedMember.Global", Justification = "No tests written for this.")]
public void Init()
{
if (this.alreadyInitialized)
Expand Down

0 comments on commit f820d2c

Please sign in to comment.