using System; using System.Utility; using Chernobyl.Extensions; using NUnit.Framework; namespace Chernobyl.Generation.Test { [TestFixture, Description("Tests for the Beat type.")] public class BeatTests { [Test] public void AddBeatThrowsWhenGivenDistanceLessThanZero() { Assert.Throws(() => Func.StaticFactory(0).AddBeat(-1, () => 1)); } [Test] public void AddBeatProducesCorrectOutput() { var pattern = Func.StaticFactory(0).AddBeat(3, () => 1); new[] { pattern(), pattern(), pattern(), pattern(), pattern(), pattern() } .IsEqualTo(new [] { 0, 0, 1, 0, 0, 1}, "pattern"); } } }