Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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());
        }
Exemple #4
0
        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);
        }