public void AddIfNotContainsTestNullCheck() { // ReSharper disable once AssignNullToNotNullAttribute Action test = () => Extensions.AddIfNotContains(null, Extensions.GetRandomString()); test.ShouldThrow <NullReferenceException>(); }