public void Dispose_Should_call_Dispose_on_all_systems() { bool done1 = false; bool done2 = false; ISystem <int> s1 = Substitute.For <ISystem <int> >(); ISystem <int> s2 = Substitute.For <ISystem <int> >(); s1.When(s => s.Dispose()).Do(_ => done1 = true); s2.When(s => s.Dispose()).Do(_ => done2 = true); ISystem <int> system = new SequentialSystem <int>(s1, s2); system.Dispose(); Check.That(done1).IsTrue(); Check.That(done2).IsTrue(); }
public void Dispose() { _update.Dispose(); _draw.Dispose(); _gui.Dispose(); }