public void It_should_throw_when_the_list_is_too_short() { var lst = new List <string>(); // empty var ae = (ArgumentException) typeof(ArgumentException).ShouldBeThrownBy(() => DisposableHelp.SafeCreate(() => ClusterCredentialsFactory.CreateFromList(lst))); ae.ParamName.ShouldEqual("lines"); // one lst.Add(Guid.NewGuid().ToString()); ae = (ArgumentException) typeof(ArgumentException).ShouldBeThrownBy(() => DisposableHelp.SafeCreate(() => ClusterCredentialsFactory.CreateFromList(lst))); ae.ParamName.ShouldEqual("lines"); // two lst.Add(Guid.NewGuid().ToString()); ae = (ArgumentException) typeof(ArgumentException).ShouldBeThrownBy(() => DisposableHelp.SafeCreate(() => ClusterCredentialsFactory.CreateFromList(lst))); ae.ParamName.ShouldEqual("lines"); }
public void It_should_throw_when_the_list_is_null() { var ane = (ArgumentNullException) typeof(ArgumentNullException).ShouldBeThrownBy(() => DisposableHelp.SafeCreate(() => ClusterCredentialsFactory.CreateFromList(null))); ane.ParamName.ShouldEqual("lines"); }