/src/UnitTests/AOP/BootStrappingTests.cs
http://github.com/philiplaureano/LinFu · C# · 24 lines · 22 code · 2 blank · 0 comment · 1 complexity · 94a2779eb01184d6aa3d2819cc06af18 MD5 · raw file
- using System.Linq;
- using LinFu.AOP.Interfaces;
- using Xunit;
- using SampleLibrary.AOP;
- namespace LinFu.UnitTests.AOP
- {
- public class BootStrappingTests : BaseTestFixture
- {
- [Fact]
- public void ShouldCallTypeThatImplementsBootstrapInterface()
- {
- var registry = BootStrapRegistry.Instance;
- var bootStrappedComponents = registry.GetComponents();
- var targetComponent = (from c in bootStrappedComponents
- let type = c.GetType()
- where type == typeof(SampleBootstrapComponent)
- select c).First();
- var component = (SampleBootstrapComponent) targetComponent;
- Assert.True(component.Called);
- }
- }
- }