-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResourceEndpoints: 100% test coverage (#259)
- Loading branch information
Showing
8 changed files
with
293 additions
and
200 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
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
18 changes: 18 additions & 0 deletions
18
RefreshTests.GameServer/GameServer/ReadFailingDataStore.cs
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,18 @@ | ||
using Bunkum.Core.Storage; | ||
|
||
namespace RefreshTests.GameServer.GameServer; | ||
|
||
/// <summary> | ||
/// A data store that claims keys are always available, but returns failure when getting the data back | ||
/// </summary> | ||
public class ReadFailingDataStore : IDataStore | ||
{ | ||
public bool ExistsInStore(string key) => true; | ||
public bool WriteToStore(string key, byte[] data) => true; | ||
public byte[] GetDataFromStore(string key) => throw new NotSupportedException(); | ||
public bool RemoveFromStore(string key) => throw new NotSupportedException(); | ||
public string[] GetKeysFromStore() => throw new NotSupportedException(); | ||
public bool WriteToStoreFromStream(string key, Stream data) => true; | ||
public Stream GetStreamFromStore(string key) => throw new NotSupportedException(); | ||
public Stream OpenWriteStream(string key) => throw new NotSupportedException(); | ||
} |
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
18 changes: 18 additions & 0 deletions
18
RefreshTests.GameServer/GameServer/WriteFailingDataStore.cs
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,18 @@ | ||
using Bunkum.Core.Storage; | ||
|
||
namespace RefreshTests.GameServer.GameServer; | ||
|
||
/// <summary> | ||
/// A data store that you are unable to write to, it always returns a failure operation | ||
/// </summary> | ||
public class WriteFailingDataStore : IDataStore | ||
{ | ||
public bool ExistsInStore(string key) => false; | ||
public bool WriteToStore(string key, byte[] data) => false; | ||
public byte[] GetDataFromStore(string key) => throw new NotSupportedException(); | ||
public bool RemoveFromStore(string key) => throw new NotSupportedException(); | ||
public string[] GetKeysFromStore() => Array.Empty<string>(); | ||
public bool WriteToStoreFromStream(string key, Stream data) => false; | ||
public Stream GetStreamFromStore(string key) => throw new NotSupportedException(); | ||
public Stream OpenWriteStream(string key) => throw new NotSupportedException(); | ||
} |
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
Oops, something went wrong.