diff --git a/TestUnitaire/AppInitializer.cs b/TestUnitaire/AppInitializer.cs index 0c00000..23d1d7d 100644 --- a/TestUnitaire/AppInitializer.cs +++ b/TestUnitaire/AppInitializer.cs @@ -7,9 +7,9 @@ using Xamarin.UITest.Queries; namespace TestUnitaire { - public class AppInitializer + /*public class AppInitializer { - /*public static IApp StartApp(Platform platform) + public static IApp StartApp(Platform platform) { // TODO: If the iOS or Android app being tested is included in the solution // then open the Unit Tests window, right click Test Apps, select Add App Project @@ -38,6 +38,6 @@ namespace TestUnitaire // code if the app is not included in the solution. //.AppBundle ("../../../iOS/bin/iPhoneSimulator/Debug/XamarinForms.iOS.app") .StartApp(); - }*/ - } + } + }*/ } diff --git a/TestUnitaire/Tests.cs b/TestUnitaire/Tests.cs index 8a34a6d..142c8c0 100644 --- a/TestUnitaire/Tests.cs +++ b/TestUnitaire/Tests.cs @@ -7,7 +7,7 @@ using Xamarin.UITest.Queries; namespace TestUnitaire { - [TestFixture(Platform.Android)] + /*[TestFixture(Platform.Android)] [TestFixture(Platform.iOS)] public class Tests { @@ -30,5 +30,5 @@ namespace TestUnitaire { app.Screenshot("First screen."); } - } + }*/ } diff --git a/TheGameExtreme/AppRessource.Designer.cs b/TheGameExtreme/AppRessource.Designer.cs new file mode 100644 index 0000000..d02341d --- /dev/null +++ b/TheGameExtreme/AppRessource.Designer.cs @@ -0,0 +1,180 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace TheGameExtreme { + using System; + + + /// + /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// + // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder + // à l'aide d'un outil, tel que ResGen ou Visual Studio. + // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen + // avec l'option /str ou régénérez votre projet VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AppRessource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AppRessource() { + } + + /// + /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TheGameExtreme.AppRessource", typeof(AppRessource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Remplace la propriété CurrentUICulture du thread actuel pour toutes + /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Recherche une chaîne localisée semblable à Pile ascendante. + /// + internal static string StrAcendingStack { + get { + return ResourceManager.GetString("StrAcendingStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à La pile choisie n'existe pas!. + /// + internal static string StrCantGetStack { + get { + return ResourceManager.GetString("StrCantGetStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Vous n'avez pas joué assez de carte!. + /// + internal static string StrCardPlayedLessThanTwo { + get { + return ResourceManager.GetString("StrCardPlayedLessThanTwo", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Veuillez selectionner une carte à placer sur une pile. + /// + internal static string StrChooseCardToPlay { + get { + return ResourceManager.GetString("StrChooseCardToPlay", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Selectionner la pile sur laquelle vous souhaitez poser la carte. + /// + internal static string StrChooseStack { + get { + return ResourceManager.GetString("StrChooseStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Pile Descendante. + /// + internal static string StrDownStack { + get { + return ResourceManager.GetString("StrDownStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Fin de tour. + /// + internal static string StrEndTurn { + get { + return ResourceManager.GetString("StrEndTurn", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Le jeu est terminé! Désolé, vous avez perdu... Essayez encore!. + /// + internal static string StrLose { + get { + return ResourceManager.GetString("StrLose", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Le jeu est terminé! Désolé, vous avez perdu... Vous deviez jouer trois cartes à cause de l'effet \"Trois cartes joué\" hors votre jeu ne permet pas d'en jouer autant! Essayez encore!. + /// + internal static string StrLose3CardEffect { + get { + return ResourceManager.GetString("StrLose3CardEffect", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Le joueur n'a plus de carte dans sa main. + /// + internal static string StrNoMoreCardOnHand { + get { + return ResourceManager.GetString("StrNoMoreCardOnHand", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Désolé, vous n'avez pas recouvert la tête de mort... Réessayez ;). + /// + internal static string StrSkullEffect { + get { + return ResourceManager.GetString("StrSkullEffect", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Le jeu est terminé!\n Bravo vous avez gagné!. + /// + internal static string StrWin { + get { + return ResourceManager.GetString("StrWin", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à La carte ne rentre pas dans la pile sectionné!. + /// + internal static string StrWrongStack { + get { + return ResourceManager.GetString("StrWrongStack", resourceCulture); + } + } + } +} diff --git a/TheGameExtreme/AppRessource.resx b/TheGameExtreme/AppRessource.resx new file mode 100644 index 0000000..64a8bf6 --- /dev/null +++ b/TheGameExtreme/AppRessource.resx @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Pile ascendante + String to indicate an ascending stack + + + La pile choisie n'existe pas! + + + Vous n'avez pas joué assez de carte! + + + Veuillez selectionner une carte à placer sur une pile + String to indicate to choose a card + + + Selectionner la pile sur laquelle vous souhaitez poser la carte + String for indicate to choose a stack + + + Pile Descendante + String to indicate an down stack + + + Fin de tour + Button to end turn + + + Le jeu est terminé! Désolé, vous avez perdu... Essayez encore! + + + Le jeu est terminé! Désolé, vous avez perdu... Vous deviez jouer trois cartes à cause de l'effet \"Trois cartes joué\" hors votre jeu ne permet pas d'en jouer autant! Essayez encore! + + + Le joueur n'a plus de carte dans sa main + + + Désolé, vous n'avez pas recouvert la tête de mort... Réessayez ;) + + + Le jeu est terminé!\n Bravo vous avez gagné! + + + La carte ne rentre pas dans la pile sectionné! + + \ No newline at end of file diff --git a/TheGameExtreme/AppRessources.br.resx b/TheGameExtreme/AppRessources.br.resx new file mode 100644 index 0000000..ad114eb --- /dev/null +++ b/TheGameExtreme/AppRessources.br.resx @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rising stack + String to indicate an ascending stack + + + the chosen pile does not exist + + + You have not played enough cards! + + + Please select a card to place on a stack + String to indicate to choose a card + + + Select the stack on which you want to put the card + String for indicate to choose a stack + + + Down stack + String to indicate an down stack + + + End of turn + Button to end turn + + + The game is over! Sorry, you lost ... Try again! + + + The game is over! Sorry, you lost ... You had to play three cards because of the effect \ "Three cards played \" off your game does not play as much! Try again! + + + The player has no more cards in his hand + + + Sorry, you did not cover the skull ... Try again;) + + + The game is over! Well done you won! + + + The card does not fit in the selected stack! + + \ No newline at end of file diff --git a/TheGameExtreme/model/manager/SoloGameManager.cs b/TheGameExtreme/model/manager/SoloGameManager.cs index 3b0f346..6f031ad 100644 --- a/TheGameExtreme/model/manager/SoloGameManager.cs +++ b/TheGameExtreme/model/manager/SoloGameManager.cs @@ -67,6 +67,7 @@ namespace TheGameExtreme.model.manager else { throw new Exception("Vous n'avez pas joué assez de carte!"); + throw new Exception(AppRessource.StrCardPlayedLessThanTwo); } } @@ -75,6 +76,7 @@ namespace TheGameExtreme.model.manager if (win) { EndMessage = "Le jeu est terminé!\n Bravo vous avez gagné!"; + EndMessage = AppRessource.StrWin; } } diff --git a/UnitTestProjectGame/UnitTest1.cs b/UnitTestProjectGame/UnitTest1.cs index 79ea7cb..a79c9e9 100644 --- a/UnitTestProjectGame/UnitTest1.cs +++ b/UnitTestProjectGame/UnitTest1.cs @@ -61,17 +61,23 @@ namespace UnitTestProjectGame bool valueExpected = false; bool valueExpected1 = true; bool valueBool; + int nbCardplayed = 2; valueBool = g1.endTurn(); + try { - if (valueBool == false) - { - Assert.AreEqual(valueExpected, valueBool); - + if (valueBool == false) + { + Assert.AreEqual(valueExpected, valueBool); + } + else + { + Assert.AreEqual(valueExpected1, valueExpected1); + } } - else + catch(Exception e) { - Assert.AreEqual(valueExpected1, valueExpected1); - } + Console.WriteLine("Nb de carte joué insufisants", e); + } } [TestMethod]