     let openToRight_MayOpen = "openToRight_MayOpen"
     let openToRight_WillOpen = "openToRight_WillOpen"
     let openToRight_Opened = "openToRight_Opened"
+    let openToRight_MayOpenThenStop = "openToRight_MayOpenThenStop"
     
     override func setUp() {
         super.setUp()
         // Put setup code here. This method is called before the invocation of each test method in the class.
-        
-        self.stateMachine = ElasticMotionStateMachine(ElasticMotionDirection.Right, threshold: 50.0, vibrationSec: vibrationSec)
-        self.stateMachine?.delegate = self
     }
     
     override func tearDown() {
         // Put teardown code here. This method is called after the invocation of each test method in the class.
-        self.stateMachine?.delegate = nil
+        self.stateMachine = nil
         
         super.tearDown()
     }
     
     func testOpenToRightMayOpen() {
+        self.stateMachine = ElasticMotionStateMachine(ElasticMotionDirection.Right, threshold: 50.0, vibrationSec: vibrationSec)
+        self.stateMachine?.delegate = self
+        
         self.expectation = expectationWithDescription(openToRight_MayOpen)
         
         if let stateMachine = self.stateMachine {

            if (state == ElasticMotionState.Opened) {
                self.expectation?.fulfill()
            }
        }
    }
    

    }
    
    func testOpenToRightOpened() {
        self.stateMachine = ElasticMotionStateMachine(ElasticMotionDirection.Right, threshold: 50.0, vibrationSec: vibrationSec)
        self.stateMachine?.delegate = self
        
        self.expectation = expectationWithDescription(openToRight_Opened)
        
        if let stateMachine = self.stateMachine {
