-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
244f777
commit d6a3261
Showing
10 changed files
with
228 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
namespace Test; | ||
|
||
internal static class BreakingList | ||
{ | ||
public static BreakingList<T> AsBreakingList<T>(this IEnumerable<T> source) => new(source); | ||
} | ||
|
||
internal class BreakingList<T> : BreakingSequence<T>, IList<T>, IDisposableEnumerable<T> | ||
{ | ||
protected readonly IList<T> List; | ||
|
||
public BreakingList(params T[] values) : this((IList<T>)values) { } | ||
public BreakingList(IEnumerable<T> source) => List = source.ToList(); | ||
public BreakingList(IList<T> list) => List = list; | ||
|
||
public int Count => List.Count; | ||
|
||
public T this[int index] | ||
{ | ||
get => List[index]; | ||
set => Assert.Fail("LINQ Operators should not be calling this method."); | ||
} | ||
|
||
public int IndexOf(T item) | ||
{ | ||
Assert.Fail("LINQ Operators should not be calling this method."); | ||
return -1; | ||
} | ||
|
||
public void Add(T item) => Assert.Fail("LINQ Operators should not be calling this method."); | ||
public void Insert(int index, T item) => Assert.Fail("LINQ Operators should not be calling this method."); | ||
public void Clear() => Assert.Fail("LINQ Operators should not be calling this method."); | ||
public bool Contains(T item) => List.Contains(item); | ||
public bool Remove(T item) { Assert.Fail("LINQ Operators should not be calling this method."); return false; } | ||
public void RemoveAt(int index) => Assert.Fail("LINQ Operators should not be calling this method."); | ||
public bool IsReadOnly => true; | ||
|
||
public virtual void CopyTo(T[] array, int arrayIndex) => Assert.Fail("LINQ Operators should not be calling this method."); | ||
|
||
public void Dispose() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters