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