Skip to content

Commit

Permalink
Simplified project structure yet better defined our different functio…
Browse files Browse the repository at this point in the history
…ns of the program.
  • Loading branch information
Delubear committed Dec 3, 2024
1 parent 53f128c commit 7a3713e
Show file tree
Hide file tree
Showing 59 changed files with 272 additions and 256 deletions.
24 changes: 0 additions & 24 deletions GlucoseTray.Domain/DependencyExtensions.cs

This file was deleted.

5 changes: 5 additions & 0 deletions GlucoseTray.Domain/GlucoseTray.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="DisplayResults\" />
<Folder Include="GlucoseSettings\" />
</ItemGroup>

</Project>
79 changes: 0 additions & 79 deletions GlucoseTray.Infrastructure/ExternalCommunicationAdapter.cs

This file was deleted.

4 changes: 0 additions & 4 deletions GlucoseTray.Infrastructure/GlucoseTray.Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,4 @@
<PackageReference Include="TaskScheduler" Version="2.11.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GlucoseTray.Domain\GlucoseTray.Domain.csproj" />
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions GlucoseTray.Tests/AlertServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

using NSubstitute;
using GlucoseTray.Domain.Enums;
using GlucoseTray.Domain;
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.Enums;
using GlucoseTray.DisplayResults;
using GlucoseTray.DisplayResults.Contracts;
using GlucoseTray.GlucoseSettings.Contracts;

namespace GlucoseTray.Tests;

Expand Down
4 changes: 2 additions & 2 deletions GlucoseTray.Tests/DebugServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.Domain.FetchResults;
using GlucoseTray.DisplayResults.Contracts;
using GlucoseTray.FetchResults;
using NSubstitute;

namespace GlucoseTray.Tests;
Expand Down
7 changes: 3 additions & 4 deletions GlucoseTray.Tests/GlucoseFetchResultExtensionTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using GlucoseTray.Domain;
using GlucoseTray.Domain.Enums;
using GlucoseTray.Domain.DisplayResults;
using NSubstitute;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.Enums;
using GlucoseTray.DisplayResults.Extensions;
using GlucoseTray.GlucoseSettings.Contracts;

namespace GlucoseTray.Tests;

Expand Down
3 changes: 1 addition & 2 deletions GlucoseTray.Tests/GlucoseTray.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0">
Expand All @@ -25,7 +25,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GlucoseTray.Domain\GlucoseTray.Domain.csproj" />
<ProjectReference Include="..\GlucoseTray\GlucoseTray.csproj" />
</ItemGroup>

Expand Down
3 changes: 1 addition & 2 deletions GlucoseTray.Tests/SettingsProxyTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GlucoseTray.Domain.Enums;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.Enums;
using GlucoseTray.GlucoseSettings;
using Microsoft.Extensions.Options;
using NSubstitute;
Expand Down
4 changes: 2 additions & 2 deletions GlucoseTray.Tests/StringExtensionsTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.Domain.Enums;
using GlucoseTray.DisplayResults.Extensions;
using GlucoseTray.Enums;

namespace GlucoseTray.Tests
{
Expand Down
12 changes: 0 additions & 12 deletions GlucoseTray.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GlucoseTray", "GlucoseTray\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GlucoseTray.Tests", "GlucoseTray.Tests\GlucoseTray.Tests.csproj", "{2D51E5C0-484E-4152-8F1B-1C1CAD05B1D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlucoseTray.Infrastructure", "GlucoseTray.Infrastructure\GlucoseTray.Infrastructure.csproj", "{85E701C4-C9D5-4BA7-B5A0-BDA687F6A07A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GlucoseTray.Domain", "GlucoseTray.Domain\GlucoseTray.Domain.csproj", "{8341109F-EF71-4EA1-9277-FF612A577929}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,14 +21,6 @@ Global
{2D51E5C0-484E-4152-8F1B-1C1CAD05B1D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D51E5C0-484E-4152-8F1B-1C1CAD05B1D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D51E5C0-484E-4152-8F1B-1C1CAD05B1D9}.Release|Any CPU.Build.0 = Release|Any CPU
{85E701C4-C9D5-4BA7-B5A0-BDA687F6A07A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85E701C4-C9D5-4BA7-B5A0-BDA687F6A07A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85E701C4-C9D5-4BA7-B5A0-BDA687F6A07A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85E701C4-C9D5-4BA7-B5A0-BDA687F6A07A}.Release|Any CPU.Build.0 = Release|Any CPU
{8341109F-EF71-4EA1-9277-FF612A577929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8341109F-EF71-4EA1-9277-FF612A577929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8341109F-EF71-4EA1-9277-FF612A577929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8341109F-EF71-4EA1-9277-FF612A577929}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 1 addition & 2 deletions GlucoseTray/AppContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using GlucoseTray.Domain;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.GlucoseSettings.Contracts;
using Microsoft.Extensions.Logging;
using System.Windows.Forms;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using GlucoseTray.Domain.Enums;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.DisplayResults.Contracts;
using GlucoseTray.DisplayResults.Extensions;
using GlucoseTray.Enums;
using GlucoseTray.GlucoseSettings.Contracts;

namespace GlucoseTray.Domain.DisplayResults;
namespace GlucoseTray.DisplayResults;

public class AlertService(ISettingsProxy options, IIconService iconService, IDialogService dialogService, GlucoseResult glucoseResult)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.DisplayResults;
namespace GlucoseTray.DisplayResults.Contracts;

public interface IDialogService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.DisplayResults
namespace GlucoseTray.DisplayResults.Contracts
{
public interface IIconService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain
namespace GlucoseTray.DisplayResults.Contracts
{
public interface ISchedulingAdapter
{
Expand Down
18 changes: 18 additions & 0 deletions GlucoseTray/DisplayResults/DependencyExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using GlucoseTray.DisplayResults.Contracts;
using Microsoft.Extensions.DependencyInjection;

namespace GlucoseTray.DisplayResults;

public static class DependencyExtensions
{
public static IServiceCollection RegisterDisplayResultServices(this IServiceCollection services)
{
services
.AddScoped<AlertService, AlertService>()
.AddScoped<ISchedulingAdapter, TaskSchedulerService>()
.AddScoped<IIconService, IconService>()
.AddScoped<IDialogService, DialogService>();

return services;
}
}
2 changes: 1 addition & 1 deletion GlucoseTray/DisplayResults/DialogService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.DisplayResults.Contracts;
using System.Windows.Forms;

namespace GlucoseTray.DisplayResults;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GlucoseTray.Domain.Enums;
using GlucoseTray.Enums;

namespace GlucoseTray.Domain.DisplayResults;
namespace GlucoseTray.DisplayResults.Extensions;

public static class GlucoseFetchResultExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GlucoseTray.Domain.Enums;
using GlucoseTray.Enums;

namespace GlucoseTray.Domain.DisplayResults;
namespace GlucoseTray.DisplayResults.Extensions;

public static class StringExtensions
{
Expand Down
9 changes: 4 additions & 5 deletions GlucoseTray/DisplayResults/IconService.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using GlucoseTray.Domain;
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.Domain.Enums;
using GlucoseTray.Domain.GlucoseSettings;
using GlucoseTray.GlucoseSettings;
using GlucoseTray.DisplayResults.Contracts;
using GlucoseTray.DisplayResults.Extensions;
using GlucoseTray.Enums;
using GlucoseTray.GlucoseSettings.Contracts;
using GlucoseTray.Views.Settings;
using Microsoft.Extensions.Logging;
using System.ComponentModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using GlucoseTray.Domain;
using GlucoseTray.DisplayResults.Contracts;
using Microsoft.Win32.TaskScheduler;
using System.IO;

namespace GlucoseTray.Infrastructure;
namespace GlucoseTray.DisplayResults;

public class TaskSchedulerService : ISchedulingAdapter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum AlertLevel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum DataSource
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;

namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum DexcomServerLocation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum GlucoseUnitType
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum TrendResult
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.Enums;
namespace GlucoseTray.Enums;

public enum UpDown
{
Expand Down
6 changes: 6 additions & 0 deletions GlucoseTray/FetchResults/Contracts/IDexcomService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace GlucoseTray.FetchResults.Contracts;

public interface IDexcomService
{
Task GetLatestReadingAsync();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GlucoseTray.Domain.FetchResults
namespace GlucoseTray.FetchResults.Contracts
{
public interface IExternalCommunicationAdapter
{
Expand Down
6 changes: 6 additions & 0 deletions GlucoseTray/FetchResults/Contracts/IGlucoseFetchService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace GlucoseTray.FetchResults.Contracts;

public interface IGlucoseFetchService
{
Task GetLatestReadingsAsync();
}
6 changes: 6 additions & 0 deletions GlucoseTray/FetchResults/Contracts/INightscoutService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace GlucoseTray.FetchResults.Contracts;

public interface INightscoutService
{
Task GetLatestReadingAsync();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GlucoseTray.Domain.DisplayResults;
using GlucoseTray.DisplayResults.Contracts;

namespace GlucoseTray.Domain.FetchResults;
namespace GlucoseTray.FetchResults;

public class DebugService(IDialogService uiService)
{
Expand Down
Loading

0 comments on commit 7a3713e

Please sign in to comment.