public void ReleasesTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A releases f"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("releases(a, [[f]], []).", translated); }
public void InvokesAfterTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A invokes B after 1"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("invokes(a, b, 1, []).", translated); }
public void TypicallyCausesIfTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A typically causes alfa if pi"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("typically_causes(a, [[alfa]], [[pi]]).", translated); }
public void ImpossibleTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "impossible A if pi"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("impossible(a, [[pi]]).", translated); }
public void DisableWhenTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "disable A when 4"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("disable_between(a, 4, 4).", translated); }
public void CausesTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A causes alfa"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("causes(a, [[alfa]], []).", translated); }
public void TriggersTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "pi triggers B"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("triggers([[pi]], b).", translated); }
public void InvokesIfTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A invokes B if pi"; var translated = actionLanguageTranslator.Translate(story); Assert.AreEqual("invokes(a, b, 0, [[pi]]).", translated); }
public void InvokesAfterMinusTest() { var actionLanguageTranslator = new ActionLanguageTranslator(); var story = "A invokes B after -1"; Assert.Throws <Exception>(() => { actionLanguageTranslator.Translate(story); }); }
private string TranslateStoryToProlog(string story) { try { var translatedStory = actionLanguageTranslator.Translate(story); var scenario = FluentsContainer.Instance.FluentsToString(); return(translatedStory + '\n' + scenario); } catch (Exception e) { MessageBox.Show(e.Message + "\n" + e.InnerException.Message, "Błąd historyjki.", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } }