-
Notifications
You must be signed in to change notification settings - Fork 13
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
5 changed files
with
142 additions
and
0 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
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
32 changes: 32 additions & 0 deletions
32
tests/Modules/LocalRecordsModule.Tests/LocalRecordsModuleTests.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,32 @@ | ||
using EvoSC.Manialinks.Interfaces; | ||
using EvoSC.Modules.Official.LocalRecordsModule.Interfaces.Services; | ||
using Moq; | ||
|
||
namespace LocalRecordsModule.Tests; | ||
|
||
public class LocalRecordsModuleTests | ||
{ | ||
[Fact] | ||
public async Task Widget_Is_Shown_To_All_On_Enable() | ||
{ | ||
var manialinks = new Mock<IManialinkManager>(); | ||
var localRecords = new Mock<ILocalRecordsService>(); | ||
var module = new EvoSC.Modules.Official.LocalRecordsModule.LocalRecordsModule(manialinks.Object, localRecords.Object); | ||
|
||
await module.EnableAsync(); | ||
|
||
localRecords.Verify(m => m.ShowWidgetToAllAsync()); | ||
} | ||
|
||
[Fact] | ||
public async Task Widget_Is_Hidden_On_Disable() | ||
{ | ||
var manialinks = new Mock<IManialinkManager>(); | ||
var localRecords = new Mock<ILocalRecordsService>(); | ||
var module = new EvoSC.Modules.Official.LocalRecordsModule.LocalRecordsModule(manialinks.Object, localRecords.Object); | ||
|
||
await module.DisableAsync(); | ||
|
||
manialinks.Verify(m => m.HideManialinkAsync("LocalRecordsModule.LocalRecordsWidget")); | ||
} | ||
} |