using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
public static class Implementations
public static void GreenTea(int n)
throw new NotImplementedException();
public static IEnumerable<T> FirstHalf<T>(this IEnumerable<T> tt)
throw new NotImplementedException("IEnumerable<T> FirstHalf<T>(this IEnumerable<T> tt)");
public static void Main()
AssertGreenTeaIsCorrect(1020);
AssertGreenTeaIsCorrect(102);
AssertGreenTeaIsCorrect(10);
AssertGreenTeaIsCorrect(4);
AssertFirstHalfIsCorrect(new string [] { "North", "South", "East", "West" });
AssertFirstHalfIsCorrect(new string [] { "red", "green", "blue" });
Console.WriteLine("All tests succeeded.");
public static void AssertGreenTeaIsCorrect(int n)
Implementations.GreenTea(n);
public static void AssertFirstHalfIsCorrect(IEnumerable<string> tt)
var result = tt.FirstHalf();
if (tt.SequenceEqual(new string [] { "North", "South", "East", "West" }))
Assert.IsTrue(result.SequenceEqual(new string [] { "North", "South" }));
else if (tt.SequenceEqual(new string [] { "red", "green", "blue" }))
Assert.IsTrue(result.SequenceEqual(new string [] { "red" }));
Assert.Fail("No benchmark for sequence {0}.", string.Join(", ", tt));