Ejemplo n.º 1
0
    public void DependencyContainer_DoesNotThrowIfFlagToNotThrowSet()
    {
        DependencyContainer container = this.GetNewContainer();

        container.Register <IMockWithDependency, MockWithDependency>();

        IMockWithDependency mockObject = container.Resolve <IMockWithDependency>(false);

        Assert.IsNotNull(mockObject);
    }
Ejemplo n.º 2
0
    public void DependencyContainer_ResolvesRegisteredTypeWithDependencies()
    {
        DependencyContainer container = this.GetNewContainer();

        container.Register <IMockInterfaceObject, MockObject>();
        container.Register <IMockWithDependency, MockWithDependency>();

        IMockWithDependency resolvedObjectWithDependency = container.Resolve <IMockWithDependency>();

        Assert.IsNotNull(resolvedObjectWithDependency);
        Assert.IsNotNull(resolvedObjectWithDependency.MockInterfaceObject);
    }