public void ScriptTest() { var s = new _TestScript(); var t = s.Run(); s.er.LoggedEvents.Clear(); //Mimicking some usage-specific update loop for (int ii = 0; !t.IsCompleted; ++ii) { s.er.LoggedEvents.OnNext(s.UpdateLog(ii)); s.vn.Update(1f); } }
public void ScriptTest() { var s = new _TestScript(); var t = s.Run(); s.er.LoggedEvents.Clear(); for (int ii = 0; !t.IsCompleted; ++ii) { s.er.LoggedEvents.OnNext(s.UpdateLog(ii)); s.vn.Update(1f); } Assert.AreEqual(t.Result, 1337); ListEq(s.er.SimpleLoggedEventStrings, stored); }
public void ScriptTest() { var s = new _TestScript(); var t = s.Run(); s.er.LoggedEvents.Clear(); //Mimicking some usage-specific update loop for (int ii = 0; !t.IsCompleted; ++ii) { s.er.LoggedEvents.OnNext(s.UpdateLog(ii)); s.vn.Update(1f); if (ii == 6 || ii == 10 || ii == 14 || ii == 20) { s.vn.Confirm(); } } Assert.AreEqual(t.Result, 1337); ListEq(s.er.SimpleLoggedEventStrings, stored); }
public void ScriptTest() { var sd = new InstanceData(); var s = new _TestScript(new VNState(Cancellable.Null, "test", sd)); var t = s.Run(); s.er.LoggedEvents.Clear(); //We play a few lines, then "quit" for (int ii = 0; ii < 7; ++ii) { s.er.LoggedEvents.OnNext(s.UpdateLog(ii)); s.vn.Update(1f); if (ii == 3) { ((ChoiceInterrogator <float>)s.asker) !.AwaitingResponse.Value !(4.2f); } } s.vn.UpdateSavedata(); ListEq(sd.Location, new[] { ("test", 3) });
public void ScriptTest() { var sd = new InstanceData(); var s = new _TestScript(new VNState(Cancellable.Null, "test4", sd)); var t = s.Run(); s.er.LoggedEvents.Clear(); //We play a few lines, then "quit" for (int ii = 0; ii < 12; ++ii) { bool sendConfirm = s.vn.AwaitingConfirm.Value != null; s.er.LoggedEvents.OnNext(s.UpdateLog(ii)); s.vn.Update(1f); if (sendConfirm) { s.vn.Confirm(); } } s.vn.UpdateSavedata(); ListEq(sd.Location, new[] { ("test4", 4) });