Ejemplo 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);
        }
Ejemplo n.º 2
0
 public ILifecycle WhenDestroying(Action handler)
 {
     _destroy.AddWhenHandler(handler, true);
     return(this);
 }
Ejemplo n.º 3
0
 public ILifecycle WhenResuming(Action handler)
 {
     _resume.AddWhenHandler(handler, false);
     return(this);
 }
Ejemplo n.º 4
0
 public ILifecycle WhenSuspending(Action handler)
 {
     _suspend.AddWhenHandler(handler, false);
     return(this);
 }
Ejemplo n.º 5
0
 public ILifecycle WhenInitializing(Action handler)
 {
     ReportIfInitialized();
     _initialize.AddWhenHandler(handler, true);
     return(this);
 }