master
Baptiste ARNAUD 6 years ago
parent 350f6aeda1
commit 0e4bb88a4f

@ -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();
}*/
}
}
}*/
}

@ -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.");
}
}
}*/
}

@ -0,0 +1,180 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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é.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TheGameExtreme {
using System;
/// <summary>
/// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
/// </summary>
// 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() {
}
/// <summary>
/// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
/// </summary>
[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;
}
}
/// <summary>
/// Remplace la propriété CurrentUICulture du thread actuel pour toutes
/// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Pile ascendante.
/// </summary>
internal static string StrAcendingStack {
get {
return ResourceManager.GetString("StrAcendingStack", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à La pile choisie n&apos;existe pas!.
/// </summary>
internal static string StrCantGetStack {
get {
return ResourceManager.GetString("StrCantGetStack", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Vous n&apos;avez pas joué assez de carte!.
/// </summary>
internal static string StrCardPlayedLessThanTwo {
get {
return ResourceManager.GetString("StrCardPlayedLessThanTwo", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Veuillez selectionner une carte à placer sur une pile.
/// </summary>
internal static string StrChooseCardToPlay {
get {
return ResourceManager.GetString("StrChooseCardToPlay", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Selectionner la pile sur laquelle vous souhaitez poser la carte.
/// </summary>
internal static string StrChooseStack {
get {
return ResourceManager.GetString("StrChooseStack", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Pile Descendante.
/// </summary>
internal static string StrDownStack {
get {
return ResourceManager.GetString("StrDownStack", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Fin de tour.
/// </summary>
internal static string StrEndTurn {
get {
return ResourceManager.GetString("StrEndTurn", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Le jeu est terminé! Désolé, vous avez perdu... Essayez encore!.
/// </summary>
internal static string StrLose {
get {
return ResourceManager.GetString("StrLose", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Le jeu est terminé! Désolé, vous avez perdu... Vous deviez jouer trois cartes à cause de l&apos;effet \&quot;Trois cartes joué\&quot; hors votre jeu ne permet pas d&apos;en jouer autant! Essayez encore!.
/// </summary>
internal static string StrLose3CardEffect {
get {
return ResourceManager.GetString("StrLose3CardEffect", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Le joueur n&apos;a plus de carte dans sa main.
/// </summary>
internal static string StrNoMoreCardOnHand {
get {
return ResourceManager.GetString("StrNoMoreCardOnHand", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Désolé, vous n&apos;avez pas recouvert la tête de mort... Réessayez ;).
/// </summary>
internal static string StrSkullEffect {
get {
return ResourceManager.GetString("StrSkullEffect", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à Le jeu est terminé!\n Bravo vous avez gagné!.
/// </summary>
internal static string StrWin {
get {
return ResourceManager.GetString("StrWin", resourceCulture);
}
}
/// <summary>
/// Recherche une chaîne localisée semblable à La carte ne rentre pas dans la pile sectionné!.
/// </summary>
internal static string StrWrongStack {
get {
return ResourceManager.GetString("StrWrongStack", resourceCulture);
}
}
}
}

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="StrAcendingStack" xml:space="preserve">
<value>Pile ascendante</value>
<comment>String to indicate an ascending stack</comment>
</data>
<data name="StrCantGetStack" xml:space="preserve">
<value>La pile choisie n'existe pas!</value>
</data>
<data name="StrCardPlayedLessThanTwo" xml:space="preserve">
<value>Vous n'avez pas joué assez de carte!</value>
</data>
<data name="StrChooseCardToPlay" xml:space="preserve">
<value>Veuillez selectionner une carte à placer sur une pile</value>
<comment>String to indicate to choose a card</comment>
</data>
<data name="StrChooseStack" xml:space="preserve">
<value>Selectionner la pile sur laquelle vous souhaitez poser la carte</value>
<comment>String for indicate to choose a stack</comment>
</data>
<data name="StrDownStack" xml:space="preserve">
<value>Pile Descendante</value>
<comment>String to indicate an down stack</comment>
</data>
<data name="StrEndTurn" xml:space="preserve">
<value>Fin de tour</value>
<comment>Button to end turn</comment>
</data>
<data name="StrLose" xml:space="preserve">
<value>Le jeu est terminé! Désolé, vous avez perdu... Essayez encore!</value>
</data>
<data name="StrLose3CardEffect" xml:space="preserve">
<value>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!</value>
</data>
<data name="StrNoMoreCardOnHand" xml:space="preserve">
<value>Le joueur n'a plus de carte dans sa main</value>
</data>
<data name="StrSkullEffect" xml:space="preserve">
<value>Désolé, vous n'avez pas recouvert la tête de mort... Réessayez ;)</value>
</data>
<data name="StrWin" xml:space="preserve">
<value>Le jeu est terminé!\n Bravo vous avez gagné!</value>
</data>
<data name="StrWrongStack" xml:space="preserve">
<value>La carte ne rentre pas dans la pile sectionné!</value>
</data>
</root>

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="StrAcendingStack" xml:space="preserve">
<value>rising stack</value>
<comment>String to indicate an ascending stack</comment>
</data>
<data name="StrCantGetStack" xml:space="preserve">
<value>the chosen pile does not exist</value>
</data>
<data name="StrCardPlayedLessThanTwo" xml:space="preserve">
<value>You have not played enough cards!</value>
</data>
<data name="StrChooseCardToPlay" xml:space="preserve">
<value>Please select a card to place on a stack</value>
<comment>String to indicate to choose a card</comment>
</data>
<data name="StrChooseStack" xml:space="preserve">
<value>Select the stack on which you want to put the card</value>
<comment>String for indicate to choose a stack</comment>
</data>
<data name="StrDownStack" xml:space="preserve">
<value>Down stack</value>
<comment>String to indicate an down stack</comment>
</data>
<data name="StrEndTurn" xml:space="preserve">
<value>End of turn</value>
<comment>Button to end turn</comment>
</data>
<data name="StrLose" xml:space="preserve">
<value>The game is over! Sorry, you lost ... Try again!</value>
</data>
<data name="StrLose3CardEffect" xml:space="preserve">
<value>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!</value>
</data>
<data name="StrNoMoreCardOnHand" xml:space="preserve">
<value>The player has no more cards in his hand</value>
</data>
<data name="StrSkullEffect" xml:space="preserve">
<value>Sorry, you did not cover the skull ... Try again;)</value>
</data>
<data name="StrWin" xml:space="preserve">
<value>The game is over! Well done you won!</value>
</data>
<data name="StrWrongStack" xml:space="preserve">
<value>The card does not fit in the selected stack!</value>
</data>
</root>

@ -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;
}
}

@ -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]

Loading…
Cancel
Save