public static void BeforeEachTest(TestContext testContext) { _systemUnderTest = new Character { Name = "Aleron", Class = new Class { }, Faction = new Faction { }, Race = new Race { }, IsDeleted = false, Level = 50 }; }
public async Task<IHttpActionResult> Put(Character character) { throw new NotImplementedException(); }
public async Task<IHttpActionResult> Patch(string name, Character character) { throw new NotImplementedException(); }
/// <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; }
public static void AfterEachTest() { _systemUnderTest = null; }