Esempio n. 1
0
        public void beforeHandlers_are_run()
        {
            List <string> expected = new List <string> {
                "a", "b", "c"
            };
            List <string> actual = new List <string>();

            transition.AddBeforeHandler(delegate(){
                actual.Add("a");
            });
            transition.AddBeforeHandler(delegate(){
                actual.Add("b");
            });
            transition.AddBeforeHandler(delegate(){
                actual.Add("c");
            });
            transition.Enter();
            Assert.That(actual, Is.EqualTo(expected).AsCollection);
        }
Esempio n. 2
0
 public ILifecycle BeforeDestroying(Action handler)
 {
     _destroy.AddBeforeHandler(handler);
     return(this);
 }
Esempio n. 3
0
 public ILifecycle BeforeResuming(Action handler)
 {
     _resume.AddBeforeHandler(handler);
     return(this);
 }
Esempio n. 4
0
 public ILifecycle BeforeSuspending(Action handler)
 {
     _suspend.AddBeforeHandler(handler);
     return(this);
 }
Esempio n. 5
0
 public ILifecycle BeforeInitializing(Action handler)
 {
     ReportIfNotUnitialized();
     _initialize.AddBeforeHandler(handler);
     return(this);
 }