コード例 #1
0
ファイル: PlayerTest.cs プロジェクト: whasian/Blizzard
        public void InvalidDeleteNonexistant()
        {
            Player p = new Player("testName", "testPassword");

            try
            {
                p.Delete(Guid.NewGuid());
                Assert.Fail();
            }
            catch(Exception ex)
            {
                Assert.AreEqual(ex.Message, "This Character does not exist");
            }
        }
コード例 #2
0
ファイル: PlayerTest.cs プロジェクト: whasian/Blizzard
        public void InvalidDeleteAlreadyDeleted()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));

            try
            {
                p.Delete(p.Characters.First().Id);
                p.Delete(p.Characters.First().Id);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.AreEqual(ex.Message, "This Character has already been deleted");
            }
        }
コード例 #3
0
ファイル: PlayerTest.cs プロジェクト: whasian/Blizzard
        public void ValidDelete()
        {
            Player p = new Player("testName", "testPassword");

            p.AddCharacter(new Character("TestCharacter", CharacterFaction.Alliance, CharacterRace.Human, CharacterClass.Warrior));

            p.Delete(p.Characters.First().Id);
        }