public void ServiceLocator_returns_the_service_locator_passed_in_the_constructor() { var expected = new MockServiceLocator(); var resolver = new TurbineDependencyResolver(expected); var locator = resolver.ServiceLocator; Assert.AreSame(expected, locator); }
public void GetService_returns_null_when_the_service_locator_throws() { var locator = new MockServiceLocator(); var resolver = new TurbineDependencyResolver(locator); var result = resolver.GetService(ATypeThatCannotBeResolved()); Assert.IsNull(result); }
public void GetServices_returns_results_from_ResolveServices_call_on_service_locator() { var locator = new MockServiceLocator(); var resolver = new TurbineDependencyResolver(locator); var results = resolver.GetServices(ATypeThatCanBeResolved()); Assert.AreEqual(2, results.Count()); }
public void GetService_returns_results_from_Resolve_call_on_serivce_locator() { var locator = new MockServiceLocator(); var resolver = new TurbineDependencyResolver(locator); var result = resolver.GetService(ATypeThatCanBeResolved()); Assert.AreEqual("expected", result); }