Skip to content

Instantly share code, notes, and snippets.

@JohanLarsson
Created July 28, 2014 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohanLarsson/aee41becd0d591c290fa to your computer and use it in GitHub Desktop.
Save JohanLarsson/aee41becd0d591c290fa to your computer and use it in GitHub Desktop.
using Xunit;
public class Tests
{
[Fact]
public void Meh()
{
int i = 0;
foreach (var item in new Collection())
{
Console.WriteLine(item);
i++;
if (i > 3)
{
break;
}
}
}
}
public class Collection
{
public Enumerator GetEnumerator()
{
return new Enumerator();
}
}
public class Enumerator
{
public bool MoveNext()
{
return true;
}
public object Current { get { return 4; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment