public void WhenRegisterAServiceAndTryToGetIt_ReturnTheRegisteredService() { var serviceLocator = new Services.ServiceLocator.ServiceLocator(); var service = new TestService1(); serviceLocator.Register <ITestService>(service); Assert.AreEqual(service, serviceLocator.Get <ITestService>()); }
public void WhenTryToGetUnregisterService_ThrowAnException() { var serviceLocator = new Services.ServiceLocator.ServiceLocator(); Assert.Throws <KeyNotFoundException>(() => serviceLocator.Get <ITestService>()); }