Created
July 9, 2009 23:14
-
-
Save mausch/144086 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Castle.Windsor; | |
using NUnit.Framework; | |
namespace WindsorInitConfig { | |
[TestFixture] | |
public class NoResolutionTests { | |
public interface IServiceA {} | |
public class ServiceA: IServiceA {} | |
public class Service { | |
public IServiceA Svc { get; set; } | |
} | |
[Test] | |
public void NoPropInjection() { | |
var c = new WindsorContainer(); | |
c.Kernel.ComponentModelCreated += model => { | |
if (model.Implementation == typeof(Service)) | |
model.Properties.Clear(); | |
}; | |
c.AddComponent<IServiceA, ServiceA>(); | |
c.AddComponent<Service>(); | |
Assert.IsNull(c.Resolve<Service>().Svc); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment