-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
85 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
namespace GangsAPI.Data; | ||
|
||
[Obsolete] | ||
public interface ICacher { | ||
[Obsolete] | ||
void ClearCache(); | ||
[Obsolete] | ||
Task Load(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using GangsAPI.Services.Gang; | ||
using GangsAPI.Services.Player; | ||
|
||
namespace GangsTest.API.Services.Gang; | ||
|
||
public class PersistenceTests { | ||
[Theory] | ||
[ClassData(typeof(TestData))] | ||
public async Task Load_Steam(IGangManager mgr) { | ||
var id = (ulong)new Random().NextInt64(); | ||
Assert.NotNull(await mgr.CreateGang("Test Gang", id)); | ||
var gang = await mgr.GetGang(id); | ||
Assert.NotNull(gang); | ||
Assert.Equal("Test Gang", gang.Name); | ||
} | ||
|
||
[Theory] | ||
[ClassData(typeof(TestData))] | ||
public async Task Load_By_ID(IGangManager mgr) { | ||
var gang = | ||
await mgr.CreateGang("Test Gang", (ulong)new Random().NextInt64()); | ||
Assert.NotNull(gang); | ||
var id = gang.GangId; | ||
gang = await mgr.GetGang(id); | ||
Assert.NotNull(gang); | ||
Assert.Equal("Test Gang", gang.Name); | ||
} | ||
|
||
[Theory] | ||
[ClassData(typeof(TestData))] | ||
public async Task Load_By_ID_Multiple(IGangManager mgr) { | ||
var gang1 = | ||
await mgr.CreateGang("Test Gang 1", (ulong)new Random().NextInt64()); | ||
var gang2 = | ||
await mgr.CreateGang("Test Gang 2", (ulong)new Random().NextInt64()); | ||
var gang3 = | ||
await mgr.CreateGang("Test Gang 3", (ulong)new Random().NextInt64()); | ||
Assert.NotNull(gang1); | ||
Assert.NotNull(gang2); | ||
Assert.NotNull(gang3); | ||
var id = gang2.GangId; | ||
var gang = await mgr.GetGang(id); | ||
Assert.NotNull(gang); | ||
Assert.Equal("Test Gang 2", gang.Name); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.