コード例 #1
0
 public static void BeforeEachTest(TestContext testContext)
 {
     _systemUnderTest = new Character
     {
         Name = "Aleron",
         Class = new Class { },
         Faction = new Faction { },
         Race = new Race { },
         IsDeleted = false,
         Level = 50
     };
 }
コード例 #2
0
 public async Task<IHttpActionResult> Put(Character character)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 public async Task<IHttpActionResult> Patch(string name, Character character)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
        /// <summary>
        /// Checks if a new character has valid settings
        /// </summary>
        /// <param name="character">The potential character</param>
        /// <returns></returns>
        private CharacterCreationStatusCode CanCreateCharacter(Character character)
        {
            if (!SelectedClassExists(character.ClassId)) return CharacterCreationStatusCode.ClassDoesNotExist;

            if (!SelectedRaceExists(character.RaceId)) return CharacterCreationStatusCode.RaceDoesNotExist;

            if (!SelectedFactionExists(character.FactionId)) return CharacterCreationStatusCode.FactionDoesNotExist;

            if (!character.LevelIsValid()) return CharacterCreationStatusCode.LevelOutOfBound;

            if (!character.IsValid()) return CharacterCreationStatusCode.UncaughtModelError;

            if (!CanBeClass(character.RaceId, character.ClassId)) return CharacterCreationStatusCode.InvalidRaceClassMapping;

            if (!CanJoinFaction(character.RaceId, character.FactionId)) return CharacterCreationStatusCode.InvalidRaceFactionMapping;

            if (IsCharacterNameAlreadyTaken(character.Name)) return CharacterCreationStatusCode.AlreadyExists;

            if (character.ClassId == "Death Knight")
            {
                if (!CanBeCreateKnight(Username)) return CharacterCreationStatusCode.UserLevelRequirementsNotMet;
            }

            return CharacterCreationStatusCode.Created;
        }
コード例 #5
0
 public static void AfterEachTest()
 {
     _systemUnderTest = null;
 }