using System; using System.Collections.Generic; using System.Text; using UnitTestSharp; using DNAModule.Sunweaver.DataPrototypes; namespace DNAModule.Sunweaver.UnitTests { public class BoolStackTest : TestFixture { BoolStack Stack = new BoolStack(); public override void TestSetup() { Stack = new BoolStack(); } public void RoundTripsSuccessfully() { Stack.Push(false); Stack.Push(true); Stack.Push(false); CheckTrue( Stack.Pop() == false); CheckTrue( Stack.Pop() == true); CheckTrue( Stack.Pop() == false); } public void ReturnsTrueWhenEmpty() { CheckTrue( Stack.Pop() == true); } public void PeeksProperly() { Stack.Push(false); CheckFalse( Stack.Peek()); Stack.Push(true); CheckTrue( Stack.Peek()); } public void PeeksWhenEmpty() { CheckEqual((long)0, Stack.Count()); CheckTrue( Stack.Peek()); } } }