Skip to content

Commit

Permalink
Move Mock into Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Aug 31, 2024
1 parent 756950b commit 0485d90
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Gangs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GangsPlugin", "GangsPlugin\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GangsTest", "GangsTest\GangsTest.csproj", "{B1D1E7C7-BDF3-4238-9025-4FEB2B7DAB89}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mock", "Mock\Mock.csproj", "{140E1706-30E8-4440-AAA0-56E8DD32F054}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mock", "GangsImpl\Mock\Mock.csproj", "{140E1706-30E8-4440-AAA0-56E8DD32F054}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GangsImpl", "GangsImpl", "{3AB7703F-880F-4A41-96EE-B891FA888C65}"
EndProject
Expand Down
13 changes: 13 additions & 0 deletions GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Mock/MemoryImpl.cs → GangsImpl/Mock/MemoryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GangsAPI.Services;
using Microsoft.Extensions.DependencyInjection;

namespace GangsImpl.Memory;
namespace Mock;

public static class MemoryImpl {
public static void AddMemoryImpl(this IServiceCollection collection) {
Expand Down
5 changes: 1 addition & 4 deletions Mock/Mock.csproj → GangsImpl/Mock/Mock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<RootNamespace>GangsImpl.Memory</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand All @@ -23,6 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\GangsAPI\GangsAPI.csproj" />
<ProjectReference Include="..\GangsAPI\GangsAPI.csproj"/>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Mock/MockGang.cs → GangsImpl/Mock/MockGang.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GangsAPI.Data.Stat;
using GangsAPI.Permissions;

namespace GangsImpl.Memory;
namespace Mock;

public class MockGang : IGang {
public MockGang(int id, string name, ulong owner) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GangsAPI.Data.Gang;
using GangsAPI.Services;

namespace GangsImpl.Memory;
namespace Mock;

public class MockGangManager : IGangManager {
private readonly HashSet<IGang> gangs = [];
Expand Down
2 changes: 1 addition & 1 deletion Mock/MockGangRank.cs → GangsImpl/Mock/MockGangRank.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GangsAPI.Permissions;

namespace GangsImpl.Memory;
namespace Mock;

public class MockGangRank(int rank, string name,
IGangRank.Permissions perms = 0) : IGangRank {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GangsAPI.Data.Stat;
using GangsAPI.Services;

namespace GangsImpl.Memory;
namespace Mock;

public class MockInstanceStatManager(IStatManager mgr)
: IPlayerStatManager, IGangStatManager {
Expand Down
2 changes: 1 addition & 1 deletion Mock/MockPlayer.cs → GangsImpl/Mock/MockPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GangsAPI.Data.Stat;
using GangsAPI.Permissions;

namespace GangsImpl.Memory;
namespace Mock;

public class MockPlayer(ulong steam) : IGangPlayer {
public ulong Steam { get; } = steam;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GangsAPI.Data.Gang;
using GangsAPI.Services;

namespace GangsImpl.Memory;
namespace Mock;

public class MockPlayerManager : IPlayerManager {
private readonly Dictionary<ulong, IGangPlayer> players = new();
Expand Down
2 changes: 1 addition & 1 deletion Mock/MockStat.cs → GangsImpl/Mock/MockStat.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GangsAPI.Data.Stat;

namespace GangsImpl.Memory;
namespace Mock;

public class MockStat(string statId, string name, string? desc) : IStat {
public string StatId { get; } = statId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GangsAPI.Data.Stat;
using GangsAPI.Services;

namespace GangsImpl.Memory;
namespace Mock;

public class MockStatManager : IStatManager {
private readonly HashSet<IStat> cachedStats = [], backendStats = [];
Expand Down
2 changes: 1 addition & 1 deletion GangsImpl/SQLite/SQLiteStatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GenericDB;
using Microsoft.Data.Sqlite;

namespace GangsImpl.SQLLite;
namespace SQLite;

public class SQLiteStatManager(string connectionString,
string table = "gang_stats", bool testing = false)
Expand Down
2 changes: 1 addition & 1 deletion GangsTest/GangTests/GangManagerData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections;
using GangsAPI;
using GangsImpl.Memory;
using Mock;

namespace GangsTest.GangTests;

Expand Down
2 changes: 1 addition & 1 deletion GangsTest/GangTests/GangManagerTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Mock;

namespace GangsTest.GangTests;

Expand Down
2 changes: 1 addition & 1 deletion GangsTest/GangTests/GangMutabilityTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Mock;

namespace GangsTest.GangTests;

Expand Down
3 changes: 1 addition & 2 deletions GangsTest/GangsTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<ItemGroup>
<Using Include="Xunit"/>
<!-- Disable parallelism for xunit tests -->
</ItemGroup>

<ItemGroup>
Expand All @@ -29,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Mock\Mock.csproj"/>
<ProjectReference Include="..\GangsImpl\Mock\Mock.csproj"/>
<ProjectReference Include="..\GangsImpl\SQLite\SQLite.csproj"/>
<ProjectReference Include="..\GangsImpl\SQL\SQL.csproj"/>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GangsTest/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Microsoft.Extensions.DependencyInjection;
using Mock;

namespace GangsTest;

Expand Down
4 changes: 2 additions & 2 deletions GangsTest/StatTests/StatManagerData.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections;
using GangsAPI;
using GangsImpl.Memory;
using GangsImpl.SQLLite;
using Mock;
using SQLImpl;
using SQLite;

namespace GangsTest.StatTests;

Expand Down

0 comments on commit 0485d90

Please sign in to comment.