1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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
19 using NUnit
.Framework
;
21 using AspectSharp
.Lang
.AST
;
22 using AspectSharp
.Lang
.Steps
;
23 using AspectSharp
.Lang
.Steps
.Types
;
24 using AspectSharp
.Lang
.Steps
.Semantic
;
27 /// Summary description for PruneTypesStepTestCase.
30 public class PruneTypesStepTestCase
: ParserTestCaseBase
33 public void InvalidInterceptor()
35 String content
= " " +
38 "\"customer\" : System.Collections.Hashtable" +
41 EngineConfiguration conf
= ProcessContent(content
);
42 Assert
.IsTrue(_context
.HasErrors
);
43 AssertOutput( "The specified type for an interceptor doesn't implement the interceptor interface;" );
47 public void ValidInterceptor()
49 String content
= " " +
52 "\"customer\" : AspectSharp.Lang.Tests.Types.Interceptors.DummyInterceptor in AspectSharp.Lang.Tests" +
55 EngineConfiguration conf
= ProcessContent(content
);
56 Assert
.IsFalse(_context
.HasErrors
);
60 public void InvalidMixin()
62 String content
= " " +
65 "\"customer\" : System.Collections.IList" +
68 EngineConfiguration conf
= ProcessContent(content
);
69 Assert
.IsTrue(_context
.HasErrors
);
70 AssertOutput( "The specified type for a mixin is an interface which is invalid;" );
73 protected override void AddSteps(StepChainBuilder chain
)
75 chain
.AddStep(new SemanticAnalizerStep());
76 chain
.AddStep(new ResolveTypesStep());
77 chain
.AddStep(new PruneTypesStep());