public void GetPhrase_Tests() { Phrase sut = new Phrase(); string phrase = sut.GetPhrase(); for (int i = 0; i < 10; i++) { string newPhrase = sut.GetPhrase(); Assert.NotEqual(newPhrase, phrase); phrase = newPhrase; } }
public string WriteDescription() { // ici en fait, il faudrait aussi que les phrases d'accroches aient des paramètres dans une db // exemple : "vous êtes encore/DEFINED/LOC|PREP/Singular etc... Word word = tileItem.word; string str = ""; // tile is continued ( road, forest etc... ) if (SameAsPrevious() && tileItem.stackable) { str = Phrase.GetPhrase("tile_continue"); } else if (visited == false) { str = Phrase.GetPhrase("tile_discover"); } else { str = Phrase.GetPhrase("tile_goback"); } Phrase.Write(str); return(str); }
public void CheckSentenceBool_CheckIfSentHasSym_true() { string userPhrase = "wor#$d"; string userWord = "word"; Phrase newPhrase = new Phrase(userPhrase, userWord); string checkedSent = newPhrase.GetPhrase(); bool result = newPhrase.HasSym(checkedSent); Assert.AreEqual(true, result); }
public void GetPhrase_ReturnsPhrase_String() { string phrase = "word word word"; string checkedWord = "word"; Phrase newPhrase = new Phrase(phrase, checkedWord); string result = newPhrase.GetPhrase(); string resultWord = newPhrase.GetWord(); Assert.AreEqual(result, phrase); Assert.AreEqual(resultWord, checkedWord); }
public void CheckSpaceBool_ChecksIfSentHasSpace_True() { string userPhrase = "word word word"; string userWord = "word"; Phrase newPhrase = new Phrase(userPhrase, userWord); string checkedPhrase = newPhrase.GetPhrase(); bool result = newPhrase.HasSpace(checkedPhrase); Assert.AreEqual(true, result); }
public ActionResult Create(string sentence, string checkedword) { Phrase newphrase = new Phrase(sentence, checkedword); string userPhrase = newphrase.GetPhrase().ToLower(); bool numPhrase = newphrase.HasNum(userPhrase); newphrase.RemoveNum(); string userWord = newphrase.GetWord().ToLower(); int wordCount = newphrase.CheckRepeatedWord(); return(View("Index", newphrase)); }
public static string GetSurroundingTileDescription(TileGroup surroundingTile) { Phrase.orientations = surroundingTile.orientations; // same tile if (Tile.GetCurrent.tileItem.SameTypeAs(surroundingTile.tile.tileItem)) { if (Tile.GetCurrent.tileItem.stackable) { // tu es dans une forêt, la forêt continue return(Phrase.GetPhrase("surroundingTile_continue", surroundingTile.tile.tileItem)); } else { // tu es près d'une maison, tu vois une maison que tu connais pas return(Phrase.GetPhrase("surroundingTile_discover", surroundingTile.tile.tileItem)); } } // new tile if (Interior.InsideInterior()) { // tu es dans la cuisine, et tu vois LE couloir ( dans un intérieur, les articles définis ont plus de sens ) if (surroundingTile.tile.tileItem.stackable) { // tu es dans une forêt, la forêt continue return(Phrase.GetPhrase("surroundingTile_continue", surroundingTile.tile.tileItem)); } else { // tu es près d'une maison, tu vois une maison que tu connais pas return(Phrase.GetPhrase("surroundingTile_visited", surroundingTile.tile.tileItem)); } } else { // ici if (surroundingTile.tile.visited) { // tu vois es près d'une maison return(Phrase.GetPhrase("surroundingTile_visited", surroundingTile.tile.tileItem)); } else { return(Phrase.GetPhrase("surroundingTile_discover", surroundingTile.tile.tileItem)); } } }
public void TestSpaces() { const string text1 = " text1 "; const string text2 = " text2 "; const string expected = "text1 text2"; Phrase phrase = new Phrase(); Word word1 = new Word(text1); Word word2 = new Word(text2); phrase.AddWord(word1); phrase.AddWord(word2); string actual = phrase.GetPhrase(); Assert.Equal(expected, actual); }
public void TestSpaces() { const string text1 = " text1 "; const string text2 = " text2 "; const string expected = "text1 text2"; Phrase phrase = new Phrase(); Word word1 = new Word(text1); //Con arreglar el set con la función Trim se quitan los espacios anteriores y posteriores Word word2 = new Word(text2); phrase.AddWord(word1); phrase.AddWord(word2); string actual = phrase.GetPhrase(); // Con Trim tambien quitamos los espacios anteriores Assert.Equal(expected, actual); }
public void SetPhrase_SetsThePhrase_String() { string userPhrase = "word word word"; string checkedWord = "word"; Phrase newPhrase = new Phrase(userPhrase, checkedWord); string updatedPhrase = "another phrase"; string updatedWord = "another word"; newPhrase.SetString(updatedPhrase); newPhrase.SetWord(updatedWord); string result = newPhrase.GetPhrase(); string resultWord = newPhrase.GetWord(); Assert.AreEqual(updatedPhrase, result); Assert.AreEqual(updatedWord, resultWord); }
public void MoveToTargetItem() { Item targetItem = InputInfo.GetCurrent.MainItem; foreach (var tileGroup in TileGroupDescription.tileGroups) { if (tileGroup.tile.tileItem.SameTypeAs(targetItem)) { if (InputInfo.GetCurrent.orientation != Orientation.None) { Orientation orientation = InputInfo.GetCurrent.orientation; Phrase.orientation = orientation; if (tileGroup.orientations.Contains(orientation)) { Direction dir = GetDirection(orientation); Move(dir); } else { string str = Phrase.GetPhrase("movement_blocked"); DisplayFeedback.Instance.Display(str); } return; } else { Orientation orientation = tileGroup.orientations[0]; Phrase.orientation = orientation; Direction dir = GetDirection(orientation); Move(dir); return; } } } }