Move Mock into Impl

This commit is contained in:
MSWS
2024-08-31 04:46:15 -07:00
parent 756950bd33
commit 0485d9097c
22 changed files with 50 additions and 23 deletions

View File

@@ -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

13
GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/.idea.Mock.iml
/modules.xml
/contentModel.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@@ -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) {

View File

@@ -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>
@@ -23,6 +19,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\GangsAPI\GangsAPI.csproj" />
<ProjectReference Include="..\GangsAPI\GangsAPI.csproj"/>
</ItemGroup>

View File

@@ -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) {

View File

@@ -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 = [];

View File

@@ -1,6 +1,6 @@
using GangsAPI.Permissions;
namespace GangsImpl.Memory;
namespace Mock;
public class MockGangRank(int rank, string name,
IGangRank.Permissions perms = 0) : IGangRank {

View File

@@ -1,7 +1,7 @@
using GangsAPI.Data.Stat;
using GangsAPI.Services;
namespace GangsImpl.Memory;
namespace Mock;
public class MockInstanceStatManager(IStatManager mgr)
: IPlayerStatManager, IGangStatManager {

View File

@@ -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;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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 = [];

View File

@@ -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)

View File

@@ -1,6 +1,6 @@
using System.Collections;
using GangsAPI;
using GangsImpl.Memory;
using Mock;
namespace GangsTest.GangTests;

View File

@@ -1,5 +1,5 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Mock;
namespace GangsTest.GangTests;

View File

@@ -1,5 +1,5 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Mock;
namespace GangsTest.GangTests;

View File

@@ -19,7 +19,6 @@
<ItemGroup>
<Using Include="Xunit"/>
<!-- Disable parallelism for xunit tests -->
</ItemGroup>
<ItemGroup>
@@ -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>

View File

@@ -1,6 +1,6 @@
using GangsAPI.Services;
using GangsImpl.Memory;
using Microsoft.Extensions.DependencyInjection;
using Mock;
namespace GangsTest;

View File

@@ -1,8 +1,8 @@
using System.Collections;
using GangsAPI;
using GangsImpl.Memory;
using GangsImpl.SQLLite;
using Mock;
using SQLImpl;
using SQLite;
namespace GangsTest.StatTests;