-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#115 refactor: getinterface method is now part of the wireguard config
+ Also added calls to AddClient and RemoveClient where needed
- Loading branch information
1 parent
ed56e90
commit 42d1eb3
Showing
11 changed files
with
40 additions
and
27 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
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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
using Linguard.Core.Managers; | ||
using Linguard.Core.Models.Wireguard; | ||
using Linguard.Core.Models.Wireguard; | ||
using Linguard.Core.OS; | ||
using Linguard.Core.Services; | ||
using Moq; | ||
|
||
namespace WebMock; | ||
|
||
public class WireguardServiceMock : Mock<IWireguardService> { | ||
public WireguardServiceMock(IConfigurationManager configurationManager, ISystemWrapper systemWrapper) { | ||
public WireguardServiceMock(ISystemWrapper systemWrapper) { | ||
Setup(o => o.StartInterface(It.IsAny<Interface>())) | ||
.Callback<Interface>(systemWrapper.AddNetworkInterface); | ||
Setup(o => o.StopInterface(It.IsAny<Interface>())) | ||
.Callback<Interface>(systemWrapper.RemoveNetworkInterface); | ||
Setup(o => o.GetInterface(It.IsAny<Client>())) | ||
.Returns<Client>(c => | ||
configurationManager.Configuration.Wireguard.Interfaces | ||
.SingleOrDefault(i => i.Clients.Contains(c)) | ||
); | ||
} | ||
} |