public void Any()
 {
     Assert.Throws <ArgumentNullException>(() => ImmutableArrayExtensions.Any(oneElement, null));
     Assert.True(ImmutableArrayExtensions.Any(oneElement));
     Assert.True(ImmutableArrayExtensions.Any(manyElements, n => n == 2));
     Assert.False(ImmutableArrayExtensions.Any(manyElements, n => n == 4));
 }
 public void Any()
 {
     AssertExtensions.Throws <ArgumentNullException>("predicate", () => ImmutableArrayExtensions.Any(s_oneElement, null));
     Assert.True(ImmutableArrayExtensions.Any(s_oneElement));
     Assert.True(ImmutableArrayExtensions.Any(s_manyElements, n => n == 2));
     Assert.False(ImmutableArrayExtensions.Any(s_manyElements, n => n == 4));
     Assert.True(ImmutableArrayExtensions.Any(s_oneElementBuilder));
 }
Beispiel #3
0
 public void AnyEmptyDefault()
 {
     Assert.Throws <NullReferenceException>(() => ImmutableArrayExtensions.Any(emptyDefault));
     Assert.Throws <NullReferenceException>(() => ImmutableArrayExtensions.Any(emptyDefault, n => true));
     Assert.Throws <NullReferenceException>(() => ImmutableArrayExtensions.Any(emptyDefault, null));
 }
Beispiel #4
0
 public void AnyEmpty()
 {
     Assert.Throws <ArgumentNullException>(() => ImmutableArrayExtensions.Any(empty, null));
     Assert.False(ImmutableArrayExtensions.Any(empty));
     Assert.False(ImmutableArrayExtensions.Any(empty, n => true));
 }
        private static bool HasCsLuaAddOnAttribute(INamedTypeSymbol symbol)
        {
            var attributes = symbol.GetAttributes();

            return(attributes != null && ImmutableArrayExtensions.Any(attributes, attribute => attribute.AttributeClass.Name == nameof(CsLuaAddOnAttribute)));
        }
 public void AnyEmptyDefault()
 {
     TestExtensionsMethods.ValidateDefaultThisBehavior(() => ImmutableArrayExtensions.Any(s_emptyDefault));
     TestExtensionsMethods.ValidateDefaultThisBehavior(() => ImmutableArrayExtensions.Any(s_emptyDefault, n => true));
     TestExtensionsMethods.ValidateDefaultThisBehavior(() => ImmutableArrayExtensions.Any(s_emptyDefault, null));
 }