public void AddRequiredAnySteps_Should_Throw() { DependencyCollection dc = new DependencyCollection(); dc.AddRequiredAnySteps(new[] { typeof(String) }); Action a = () => { dc.AddRequiredAnySteps(new[] { typeof(String) }); }; a.ShouldThrow <DuplicateDependencyException>(); }