public void SMKEE() { // Arrange int value = 0; bool pass = false; IEnumerator <ICoData> TestMethod() { value = 1; // ReSharper disable once AccessToModifiedClosure yield return(CoRoCtrl.WaitUntilTrue(() => pass)); value = 2; } // Act & Assert CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); Assert.AreEqual(0, value); CoRoCtrl.RunCoRoutine(TestMethod()); Assert.AreEqual(1, value); CoRoCtrl.Update(); Assert.AreEqual(1, value); CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(1, value); pass = true; CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(2, value); }
public void GWTZL() { // Arrange int value = 0; IEnumerator <ICoData> TestMethod() { value = 1; yield return(CoRoCtrl.WaitUntilDone(CoRoCtrl.RunCoRoutine(TestMethodTwo()))); value = 4; } IEnumerator <ICoData> TestMethodTwo() { value = 2; yield return(CoRoCtrl.WaitForOneTick()); value = 3; } // Act & Assert CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); Assert.AreEqual(0, value); CoRoCtrl.RunCoRoutine(TestMethod()); Assert.AreEqual(2, value); CoRoCtrl.Update(); Assert.AreEqual(2, value); CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(3, value); CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(4, value); }
public void BELZH() { // Arrange int value = 0; IEnumerator <ICoData> TestMethod() { value = 1; yield return(CoRoCtrl.WaitForSeconds(0.5f)); value = 2; } // Act & Assert CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); Assert.AreEqual(0, value); CoRoCtrl.RunCoRoutine(TestMethod()); Assert.AreEqual(1, value); CoRoCtrl.Update(); Assert.AreEqual(1, value); CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(1, value); CoRoCtrl.SetNextCoState(CoSegment.Normal, 0.33f); CoRoCtrl.Update(); Assert.AreEqual(2, value); }