public Metagross(double health, string status) { name = "Metagross"; type1 = new Steel(); type2 = new Psychic(); estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status); }
public Starmie(double health, string status) { name = "Starmie"; type1 = new Psychic(); type2 = new Water(); estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status); }
public void Highrer_CurrentGuess_max_trowException() { IPsychic psychic = new Psychic(1, 2); while (psychic.CurrentGuess == 1) { psychic = new Psychic(1, 2); } Assert.ThrowsException <HigherNotAvailibleException>(() => psychic.Higher()); }
public void Lower_CurrentGuess_min_trowException() { IPsychic psychic = new Psychic(1, 2); while (psychic.CurrentGuess == 2) { psychic = new Psychic(1, 2); } Assert.ThrowsException <LowerNotAvailibleException>(() => psychic.Lower()); }
public void Complete_trowException() { IPsychic psychic = new Psychic(1, 10); while (psychic.CurrentGuess == 10 && psychic.CurrentGuess == 1) { psychic = new Psychic(1, 10); } psychic.Correct(); Assert.ThrowsException <GameAlreadyFinishedException>(() => psychic.Higher()); }
protected override void OnBindingContextChanged() { Psychic psychique = BindingContext as Psychic; if (psychique == null) { return; } Nom.Text = psychique.Name; Description.Text = psychique.Description; Charge.Text = psychique.WarpCharge.ToString(); }
public void Lower_UpperBound_equal_CrrentGuess_minus1() { IPsychic psychic = new Psychic(1, 10); while (psychic.CurrentGuess == 10 || psychic.CurrentGuess == 1) { psychic = new Psychic(1, 10); } int oldCurrentGuess = psychic.CurrentGuess; psychic.Lower(); Assert.IsTrue(oldCurrentGuess - 1 == psychic.UpperBound); }
public void Higher_LowerBound_equal_CrrentGuess_plus1() { IPsychic psychic = new Psychic(1, 10); while (psychic.CurrentGuess == 10 || psychic.CurrentGuess == 1) { psychic = new Psychic(1, 10); } int oldCurrentGuess = psychic.CurrentGuess; psychic.Higher(); Assert.IsTrue(oldCurrentGuess + 1 == psychic.LowerBound); }
public void ReadFirstCard_MustHaveContent() { var currentDeckResult = deck.DrawCards(3); Assert.IsTrue(currentDeckResult is JsonResult); string current = (currentDeckResult as JsonResult).Value.ToString(); List <PlayingCards.Card> currentCards = JsonConvert.DeserializeObject <List <PlayingCards.Card> >(current); string message = Psychic.TranslateCard(currentCards[0]); Assert.IsNotNull(message); }
public void Create_Highrer_Lower_5times_guessCount_returned_5() { IPsychic psychic = new Psychic(1, 100); //1 time for (int i = 0; i < 4; i++) //4 more time { if (psychic.UpperBound - psychic.CurrentGuess > psychic.CurrentGuess - psychic.LowerBound) //early completion excluding { psychic.Higher(); } else { psychic.Lower(); } } Assert.AreEqual(psychic.GuessCount, 5); }
public Alakazam(double health, string status) { name = "Alakazam"; type1 = new Psychic(); estimatedSpeed = 372; estimatedHealth = 251; estimatedAttack = 122; estimatedDefense = 127; estimatedSpAttk = 369; estimatedSpDef = 226; move1 = new PsychicA(); move2 = new ShadowBall(); move3 = new FocusBlast(); move4 = new DazzlingGleam(); Initialize(name, health, status); item = "Life Orb"; }
public void Create_Highrer_Lower_5times_guessHisroty_correct() { List <int> history = new List <int>(); IPsychic psychic = new Psychic(1, 100);//1 time history.Add(psychic.CurrentGuess); for (int i = 0; i < 4; i++) //4 more time { if (psychic.UpperBound - psychic.CurrentGuess > psychic.CurrentGuess - psychic.LowerBound) //early completion excluding { psychic.Higher(); } else { psychic.Lower(); } history.Add(psychic.CurrentGuess); } List <int> objectHIstory = psychic.GuessHistory as List <int>; CollectionAssert.AreEqual(objectHIstory, history); }
static void PhysicRun() { var s = new Psychic(1, 100); while (true) { Console.WriteLine($"{s.CurrentGuess} between {s.LowerBound} and {s.UpperBound}"); var key = Console.ReadKey(); switch (key.Key) { case ConsoleKey.DownArrow: s.Lower(); break; case ConsoleKey.UpArrow: s.Higher(); break; case ConsoleKey.Enter: s.Correct(); break; } } }
// Methods private static IEnumerable <string> GetResults(Role role) { switch (role) { case Vigilante _: case Veteran _: case Mafioso _: // case Pirate _: case Ambusher _: return(new[] { Vigilante.GetName(), Veteran.GetName(), Mafioso.GetName(), Ambusher.GetName() }); case Medium _: case Janitor _: case Retributionist _: // case Necromancer _: case Trapper _: return(new[] { Medium.GetName(), Janitor.GetName(), Retributionist.GetName(), Trapper.GetName() }); case Survivor _: case VampireHunter _: case Amnesiac _: // case Medusa _: case Psychic _: return(new[] { Survivor.GetName(), VampireHunter.GetName(), Amnesiac.GetName(), Psychic.GetName() }); case Spy _: case Blackmailer _: case Jailor _: case GuardianAngel _: return(new[] { Spy.GetName(), Blackmailer.GetName(), Jailor.GetName(), GuardianAngel.GetName() }); case Sheriff _: case Executioner _: case Werewolf _: // case Poisoner _: return(new[] { Sheriff.GetName(), Executioner.GetName(), Werewolf.GetName() }); case Framer _: case Vampire _: case Jester _: // case HexMaster _: return(new[] { Framer.GetName(), Vampire.GetName(), Jester.GetName() }); case Lookout _: case Forger _: // case Juggernaut _: // case CovenLeader _: return(new[] { Lookout.GetName(), Forger.GetName() }); case Escort _: case Transporter _: case Consort _: case Hypnotist _: return(new[] { Escort.GetName(), Transporter.GetName(), Consort.GetName(), Hypnotist.GetName() }); case Doctor _: case Disguiser _: case SerialKiller _: // case PotionMaster _: return(new[] { Doctor.GetName(), Disguiser.GetName(), SerialKiller.GetName() }); case Investigator _: case Consigliere _: case Mayor _: case Tracker _: // case Plaguebearer _: return(new[] { Investigator.GetName(), Consigliere.GetName(), Mayor.GetName(), Tracker.GetName() }); case Bodyguard _: case Godfather _: case Arsonist _: case Crusader _: return(new[] { Bodyguard.GetName(), Godfather.GetName(), Arsonist.GetName(), Crusader.GetName() }); } return(new string[] { }); }
public void Create_1Min10Max_CurrentGuess1_10() { IPsychic psychic = new Psychic(1, 10); Assert.IsTrue(psychic.CurrentGuess >= 1 && psychic.CurrentGuess <= 10); }
// Methods private static string GetResult(Role role) { switch (role) { case Investigator _: return($"{role.Owner.Data.PlayerName} gathers information about people. They must be an {Investigator.GetName()}."); case Lookout _: return($"{role.Owner.Data.PlayerName} watches who visits people at night. They must be a {Lookout.GetName()}."); case Psychic _: return($"{role.Owner.Data.PlayerName} has the sight. They must be a {Psychic.GetName()}."); case Sheriff _: return($"{role.Owner.Data.PlayerName} is a protector of the {Faction.Crew.Name}. They must be a {Sheriff.GetName()}."); case Spy _: return($"{role.Owner.Data.PlayerName} secretly watches who someone visits. They must be a {Spy.GetName()}."); case Tracker _: return($"{role.Owner.Data.PlayerName} is a skilled in the art of tracking. They must be a {Tracker.GetName()}."); case Jailor _: return($"{role.Owner.Data.PlayerName} detains people at night. They must be a {Jailor.GetName()}."); case VampireHunter _: return($"{role.Owner.Data.PlayerName} tracks Vampires. They must be a {VampireHunter.GetName()}!"); case Veteran _: return($"{role.Owner.Data.PlayerName} is a paranoid war hero. They must be a {Veteran.GetName()}."); case Vigilante _: return($"{role.Owner.Data.PlayerName} will bend the law to enact justice. They must be a {Vigilante.GetName()}."); case Bodyguard _: return($"{role.Owner.Data.PlayerName} is a trained protector. They must be a {Bodyguard.GetName()}."); case Doctor _: return($"{role.Owner.Data.PlayerName} is a professional surgeon. They must be a {Doctor.GetName()}."); case Crusader _: return($"{role.Owner.Data.PlayerName} is a divine protector. They must be a {Crusader.GetName()}."); case Trapper _: return($"{role.Owner.Data.PlayerName} is waiting for a big catch. They must be a {Trapper.GetName()}."); case Escort _: return($"{role.Owner.Data.PlayerName} is a beautiful person working for the {Faction.Crew.Name}. They must be an {Escort.GetName()}."); case Mayor _: return($"{role.Owner.Data.PlayerName} is the leader of the {Faction.Crew.Name}. They must be the {Mayor.GetName()}."); case Medium _: return($"{role.Owner.Data.PlayerName} speaks with the dead. They must be a {Medium.GetName()}."); case Retributionist _: return($"{role.Owner.Data.PlayerName} wields mystical powers. They must be a {Retributionist.GetName()}."); case Transporter _: return($"{role.Owner.Data.PlayerName} specializes in transportation. They must be a {Transporter.GetName()}."); case Disguiser _: return($"{role.Owner.Data.PlayerName} makes other people appear to be someone they're not. They must be a {Disguiser.GetName()}"); case Forger _: return($"{role.Owner.Data.PlayerName} is good at forging documents. They must be a {Forger.GetName()}."); case Framer _: return($"{role.Owner.Data.PlayerName} has a desire to deceive. They must be a {Framer.GetName()}!"); case Hypnotist _: return($"{role.Owner.Data.PlayerName} is skilled at disrupting others. They must be a {Hypnotist.GetName()}."); case Janitor _: return($"{role.Owner.Data.PlayerName} cleans up dead bodies. They must be a {Janitor.GetName()}."); case Ambusher _: return($"{role.Owner.Data.PlayerName} lies in wait. They must be an {Ambusher.GetName()}."); case Godfather _: return($"{role.Owner.Data.PlayerName} is the leader of the {Faction.Mafia.Name}. They must be the {Godfather.GetName()}."); case Mafioso _: return($"{role.Owner.Data.PlayerName} does the {Godfather.GetName()}'s dirty work. They must be a {Mafioso.GetName()}."); case Blackmailer _: return($"{role.Owner.Data.PlayerName} uses information to silence people. They must be a {Blackmailer.GetName()}."); case Consigliere _: return($"{role.Owner.Data.PlayerName} gathers information for the {Faction.Mafia.Name}. They must be a {Consigliere.GetName()}."); case Consort _: return($"{role.Owner.Data.PlayerName} is a beautiful person working for the {Faction.Mafia.Name}. They must be a {Consort.GetName()}."); case Amnesiac _: return($"{role.Owner.Data.PlayerName} does not remember their role. They must be an {Amnesiac.GetName()}."); case GuardianAngel _: return($"{role.Owner.Data.PlayerName} is watching over someone. They must be a {GuardianAngel.GetName()}."); case Survivor _: return($"{role.Owner.Data.PlayerName} simply wants to live. They must be a {Survivor.GetName()}."); case Vampire _: return($"{role.Owner.Data.PlayerName} drinks blood. They must be a {Vampire.GetName()}!"); case Executioner _: return($"{role.Owner.Data.PlayerName} wants someone to be lynched at any cost. They must be an {Executioner.GetName()}."); case Jester _: return($"{role.Owner.Data.PlayerName} wants to be lynched. They must be a {Jester.GetName()}."); case Witch _: return($"{role.Owner.Data.PlayerName} casts spells on people. They must be a {Witch.GetName()}."); case Arsonist _: return($"{role.Owner.Data.PlayerName} likes to watch things burn. They must be an {Arsonist.GetName()}."); case SerialKiller _: return($"{role.Owner.Data.PlayerName} wants to kill everyone. They must be a {SerialKiller.GetName()}"); case Werewolf _: return($"{role.Owner.Data.PlayerName} howls at the moon. They must be a {Werewolf.GetName()}."); default: return("No special role found."); } }
public void UpperBound_equal_LowerBound_Complete_returned_truee() { IPsychic psychic = new Psychic(1, 1); Assert.IsTrue(psychic.Complete); }