Added option to delete service.

Added method to remove service to ServiceManager.cs.
This commit is contained in:
2020-12-27 19:14:29 -06:00
parent 53e8427b66
commit 334fd37dc6
3 changed files with 114 additions and 91 deletions

View File

@@ -50,6 +50,22 @@ namespace GameServiceWarden.Host.Tests.Modules
Assert.Contains<string>(FAKE_SERVICE_NAME, serviceManager.GetServiceNames());
}
[Fact]
public void CreateService_OneService_ServiceDeleted()
{
//Given
const string ASSEMBLY_NAME = "FakeAssembly";
const string FAKE_SERVICE_NAME = "FakeService";
ServiceManager serviceManager = new ServiceManager();
IGameServiceModule stubGameServiceModule = new FakeGameServiceModule();
serviceManager.AddModule(ASSEMBLY_NAME, stubGameServiceModule);
serviceManager.CreateService(FAKE_SERVICE_NAME, ASSEMBLY_NAME, stubGameServiceModule.Name);
//When
serviceManager.DeleteService(FAKE_SERVICE_NAME);
//Then
Assert.DoesNotContain<string>(FAKE_SERVICE_NAME, serviceManager.GetServiceNames());
}
[Fact]
public void GetServiceNames_MultipleServices_AllCorrectNames()
{