Fixing an issue with output parameters that are of type IntPtr
[castle.git] / InversionOfControl / Castle.Windsor.Tests / Installer / ConfigurationInstallerTestCase.cs
blobfaa5e1bb1d7082b4750c32837a4072c8902e791e
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.Windsor.Tests.Installer
17 using Castle.Windsor.Installer;
18 using Castle.Windsor.Tests.Components;
19 using NUnit.Framework;
21 [TestFixture]
22 public class ConfigurationInstallerTestCase
24 private IWindsorContainer container;
26 [SetUp]
27 public void Init()
29 container = new WindsorContainer();
32 [Test]
33 public void InstallComponents_FromAppConfig_ComponentsInstalled()
35 container.Install(Configuration.FromAppConfig());
37 Assert.IsTrue(container.Kernel.HasComponent(typeof(ICalcService)));
38 Assert.IsTrue(container.Kernel.HasComponent("calcservice"));
41 [Test]
42 public void InstallComponents_FromXmlFile_ComponentsInstalled()
44 container.Install(
45 Configuration.FromXmlFile(
46 ConfigHelper.ResolveConfigPath("installerconfig.xml")));
48 Assert.IsTrue(container.Kernel.HasComponent(typeof(ICalcService)));
49 Assert.IsTrue(container.Kernel.HasComponent("calcservice"));
52 [Test]
53 public void InstallComponents_FromMultiple_ComponentsInstalled()
55 container.Install(
56 Configuration.FromAppConfig(),
57 Configuration.FromXmlFile(
58 ConfigHelper.ResolveConfigPath("ignoreprop.xml")),
59 Configuration.FromXmlFile(
60 ConfigHelper.ResolveConfigPath("robotwireconfig.xml"))
63 Assert.IsTrue( container.Kernel.HasComponent(typeof(ICalcService)));
64 Assert.IsTrue( container.Kernel.HasComponent("calcservice"));
65 Assert.IsTrue(container.Kernel.HasComponent(typeof(MailServer)));
66 Assert.IsTrue(container.Kernel.HasComponent("server"));
67 Assert.IsTrue(container.Kernel.HasComponent(typeof(Robot)));
68 Assert.IsTrue(container.Kernel.HasComponent("robot"));
71 [Test]
72 public void InstallComponents_FromXmlFileWithEnvironment_ComponentsInstalled()
74 container.Install(
75 Configuration.FromXmlFile(
76 ConfigHelper.ResolveConfigPath("Configuration2/env_config.xml"))
77 .Environment("devel")
80 ComponentWithStringProperty prop =
81 (ComponentWithStringProperty)container.Resolve("component");
83 Assert.AreEqual("John Doe", prop.Name);