User: xtoff
Date: 2009/12/17 03:54 PM

Added:
 /InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/
  IoC_155.cs

Modified:
 /InversionOfControl/trunk/src/Castle.Windsor.Tests/
  Castle.Windsor.Tests-vs2008.csproj
 /InversionOfControl/trunk/src/Castle.Windsor/Installer/
  DefaultComponentInstaller.cs

Log:
 - Fixed IOC-ISSUE-155 - If the type and service is flipped no exception if 
thrown, (patch by Simon Cropp)

File Changes:

Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/
===================================================================

File [added]: IoC_155.cs
Delta lines: +1 -0
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Castle.Windsor.Tests-vs2008.csproj
        2009-12-17 22:07:21 UTC (rev 6449)
+++ 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Castle.Windsor.Tests-vs2008.csproj
        2009-12-17 22:54:42 UTC (rev 6450)
@@ -160,6 +160,7 @@
     <Compile Include="Bugs\IoC_120.cs" />
     <Compile Include="Bugs\IoC_142.cs" />
     <Compile Include="Bugs\IoC_147.cs" />
+    <Compile Include="Bugs\IoC_155.cs" />
     <Compile Include="Bugs\IoC_169\IoC_169.cs" />
     <Compile Include="Bugs\IoC_92.cs" />

Directory: /InversionOfControl/trunk/src/Castle.Windsor.Tests/
==============================================================

File [modified]: Castle.Windsor.Tests-vs2008.csproj
Delta lines: +0 -0
===================================================================

Directory: /InversionOfControl/trunk/src/Castle.Windsor/Installer/
==================================================================

File [modified]: DefaultComponentInstaller.cs
Delta lines: +48 -0
===================================================================

--- InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_155.cs           
                (rev 0)
+++ InversionOfControl/trunk/src/Castle.Windsor.Tests/Bugs/IoC_155.cs   
2009-12-17 22:54:42 UTC (rev 6450)
@@ -0,0 +1,49 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//     http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#if !SILVERLIGHT // we do not support xml config on SL
+
+namespace Castle.Windsor.Tests.Bugs
+{
+       using System.Configuration;
+    using Core.Resource;
+    using NUnit.Framework;
+    using Windsor.Configuration.Interpreters;
+
+    [TestFixture]
+    public class IoC_155
+    {
+        public interface IService { }
+
+        public class Service : IService { }
+
+        [Test]
+        public void Type_not_implementing_service_should_throw()
+        {
+            Assert.Throws<ConfigurationErrorsException>(() =>
+                new WindsorContainer(
+                    new XmlInterpreter(
+                        new StaticContentResource(
+                            @"<castle>
+<components>
+    <component id=""svc""
+        service=""Castle.Windsor.Tests.Bugs.IoC_155+Service, 
Castle.Windsor.Tests""
+        type=""Castle.Windsor.Tests.Bugs.IoC_155+IService, 
Castle.Windsor.Tests""/>
+</components>
+</castle>"))));
+        }
+    }
+}
+

--

You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=en.


Reply via email to