Exemplo n.º 1
0
        public void when_are_in_order()
        {
            List <int> actual   = new List <int>();
            List <int> expected = new List <int> {
                1, 2, 3
            };

            transition.AddWhenHandler(delegate(){
                actual.Add(1);
            });
            transition.AddWhenHandler(delegate(){
                actual.Add(2);
            });
            transition.AddWhenHandler(delegate(){
                actual.Add(3);
            });
            transition.Enter();
            Assert.That(actual, Is.EqualTo(expected).AsCollection);
        }
 public ILifecycle WhenDestroying(Action handler)
 {
     _destroy.AddWhenHandler(handler, true);
     return(this);
 }
 public ILifecycle WhenResuming(Action handler)
 {
     _resume.AddWhenHandler(handler, false);
     return(this);
 }
 public ILifecycle WhenSuspending(Action handler)
 {
     _suspend.AddWhenHandler(handler, false);
     return(this);
 }
 public ILifecycle WhenInitializing(Action handler)
 {
     ReportIfInitialized();
     _initialize.AddWhenHandler(handler, true);
     return(this);
 }