We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A clear and concise description of what is wrong.
Please provide UnitTest in the form of:
public class ObjectWithAttributes { [Dependency("name1")] public string Dependency; } Container.RegisterInstance(Name); Container.RegisterInstance(Name, Name); Container.RegisterInstance(Name1, Name1); [TestMethod] public void ResolveOverAttributeAny() { // Setup Container.RegisterType<ObjectWithAttributes>( Resolve.Field(nameof(ObjectWithAttributes.Dependency))); // Act var result = Container.Resolve<ObjectWithAttributes>(); // Verify Assert.IsNotNull(result); Assert.IsNotNull(result.Dependency); Assert.AreEqual(result.Dependency, Name1); Assert.IsNull(result.Optional); } [TestMethod] public void ResolveOverAttribute() { // Setup Container.RegisterType<ObjectWithAttributes>( new InjectionField(nameof(ObjectWithAttributes.Dependency), (string)null)); // Act var result = Container.Resolve<ObjectWithAttributes>(); // Verify Assert.IsNotNull(result); Assert.IsNotNull(result.Dependency); Assert.AreEqual(result.Dependency, Name); Assert.IsNull(result.Optional); }
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
A clear and concise description of what is wrong.
To Reproduce
Please provide UnitTest in the form of:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: