public void It_should_be_possible_to_install_new_cooridnator_when_previous_was_disposed() { using (new TestableFeatureCoordinator().InstallSelf()) { } using (var coord = new TestableFeatureCoordinator()) Assert.DoesNotThrow(() => coord.InstallSelf()); }
public void It_should_not_be_possible_to_install_multiple_coordinators_at_the_same_time() { using (var coord1 = new TestableFeatureCoordinator()) using (var coord2 = new TestableFeatureCoordinator()) { coord1.InstallSelf(); var ex = Assert.Throws <InvalidOperationException>(() => coord2.InstallSelf()); Assert.That(ex.Message, Is.EqualTo($"FeatureCoordinator of {typeof(TestableFeatureCoordinator)} type is already installed")); } }