public void resolves_components_with_ctor_with_dependencies() { var container = new YetiContainer(); container.Register <Dependecy, Dependecy>(); container.Register <ITestInterface, TestImplementationWithDepenedncy>(); var resolved_object = container.Resolve <ITestInterface>(); resolved_object.ShouldBeOfType <TestImplementationWithDepenedncy>(); }
public void throw_when_components_has_multiple_ctor() { var container = new YetiContainer(); container.Register <Dependecy, Dependecy>(); container.Register <ITestInterface, TestImplementationWithMultipleCtor>(); var exc = Record.Exception(() => container.Resolve <ITestInterface>()); exc.ShouldNotBeNull(); exc.ShouldBeOfType <ComponentHasMultipleConstructorException>(); }
public void resolves_registered_components() { var container = new YetiContainer(); container.Register <ITestInterface, TestImplementation>(); var resolved_object = container.Resolve <ITestInterface>(); resolved_object.ShouldBeOfType <TestImplementation>(); }