public void ReadOnlyArraysBroken() { var b = new ArrayBuilder <String>(); b.Add("hello"); b.Add("world"); Assert.Equal("hello", b[0]); var a = b.AsImmutable(); Assert.Equal("hello", a[0]); var e = (IEnumerable <string>)a; Assert.Equal("hello", e.First()); var aa = e.ToArray(); Assert.Equal("hello", aa[0]); var first = b.FirstOrDefault((x) => true); Assert.Equal("hello", first); ImmutableArray <int> nullOrEmpty = default(ImmutableArray <int>); Assert.True(nullOrEmpty.IsDefault); Assert.True(nullOrEmpty.IsDefaultOrEmpty); Assert.Throws <NullReferenceException>(() => nullOrEmpty.IsEmpty); nullOrEmpty = ImmutableArray.Create <int>(); Assert.True(nullOrEmpty.IsEmpty); }