Added container accessor to Castle.Core
[castle.git] / AspectSharp / AspectSharp.Lang.Tests / Types / TypeManagerTestCase.cs
blob3c266e9d313cde8f25587d526971145d819f55e2
1 // Copyright 2004-2007 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 AspectSharp.Lang.Tests.Types
17 using System;
18 using System.Reflection;
20 using AspectSharp.Lang.Steps.Types.Resolution;
22 using NUnit.Framework;
24 /// <summary>
25 /// Summary description for TypeManagerTestCase.
26 /// </summary>
27 [TestFixture]
28 public class TypeManagerTestCase
30 [Test]
31 public void InspectAppDomainAssemblies()
33 TypeManager manager = new TypeManager();
34 manager.InspectAppDomainAssemblies();
36 Type stringType = manager.ResolveType( "System.String" );
37 Assert.AreEqual( typeof(String), stringType );
39 stringType = manager.ResolveType( "String" );
40 Assert.AreEqual( typeof(String), stringType );
43 [Test]
44 public void AddAssembly()
46 TypeManager manager = new TypeManager();
47 manager.AddAssembly( Assembly.GetAssembly( typeof(TypeManagerTestCase) ) );
49 Assert.IsNull( manager.ResolveType( "System.String" ) );
50 Assert.AreEqual( typeof(TypeManagerTestCase), manager.ResolveType( "TypeManagerTestCase" ) );