public void SwitchableFeatureDeclaringAContainerInstanceShouldThrow() { var instance = new FakeIoCContainer(); Assert.Throws<InvalidOperationException>(() => new ContainerFeature<FakeIoCContainer>(When.Before, instance)); Assert.Throws<InvalidOperationException>(() => new ContainerFeature<FakeIoCContainer>(When.After, instance)); Assert.DoesNotThrow(() => new ContainerFeature<FakeIoCContainer>(When.Neither, instance)); }
public void TheSameExplicitContainerCanBeSpecifiedMultipleTimes() { Assert.DoesNotThrow(() => { var instance = new FakeIoCContainer(); CreateApplication( new ContainerFeature<FakeIoCContainer>(instance: instance), new ContainerFeature<FakeIoCContainer>(instance: instance) ); }); }
public void ExplicitContainerMustBeSpecifiedInAtLeastOneNonSwitchableFeature() { Assert.Throws<InvalidOperationException>(() => { var instance = new FakeIoCContainer(); CreateApplication( new ContainerFeature<FakeIoCContainer>(When.Before, instance), new ContainerFeature<FakeIoCContainer>() ); }); }