void RegisterTransientDifferentContractAndImplementationWithDependencyCreator_ReturnsTwoDifferentObjectsForTwoResolutions() { var container = new ExtendedSimpleContainerAdapter(); container.RegisterTransient <ITestDependency, TestDependencyA>(() => new TestDependencyA()); var firstResolution = container.Resolve <ITestDependency>(); var secondResolution = container.Resolve <ITestDependency>(); firstResolution.Should().NotBeSameAs(secondResolution); }
void RegisterTransientExplicitTypesWithDependencyCreator_ReturnsTwoDifferentObjectsForTwoResolutions() { var container = new ExtendedSimpleContainerAdapter(); container.RegisterTransient(typeof(ITestDependency), typeof(TestDependencyA), () => new TestDependencyA()); var firstResolution = container.Resolve <ITestDependency>(); var secondResolution = container.Resolve <ITestDependency>(); firstResolution.Should().NotBeSameAs(secondResolution); }