public void TestInitialize() { ea = new EventAccess(); ep = new EventProcessor(); eca = new EventCharacterAccess(); ecp = new EventCharacterProcessor(); string eventName = "Test Raid"; string eventType = "Raid"; string location = "266,070"; DateTime date = new DateTime(2020, 12, 10, 12, 0, 0); string description = "Doing a full raid. Be available for at least 2 hours"; int maxNumberOfCharacters = 25; string guildID = "99999999-9999-9999-9999-999999999999"; testEvent = new Event(guildID, eventName, description, eventType, location, date, maxNumberOfCharacters); string characterName = "Bob"; string race = "Demon"; string gender = "Both"; string profession = "Janitor"; int level = 95; string guild = "A guild"; int age = 900; string created = "Yes"; int deaths = 1; string title = "Title"; testCharacter = new Character(characterName, race, gender, profession, level, guild, age, created, deaths, title); ep.InsertEvent(testEvent.Name, testEvent.EventType, testEvent.Location, testEvent.Date, testEvent.Description, testEvent.MaxNumberOfCharacters, testEvent.GuildID); testEvent.EventID = ea.GetIdOfEvent(testEvent.Name); }
public void TestEventCreation() { Boolean InsertCompleted = false; Boolean TestThrewException = false; try { InsertCompleted = ep.InsertEvent(testEvent.Name, testEvent.EventType, testEvent.Location, testEvent.Date, testEvent.Description, testEvent.MaxNumberOfCharacters, testEvent.GuildID); }catch (Exception) { TestThrewException = true; }finally { //Cleanup int id = ea.GetIdOfEvent(testEvent.Name); ea.DeleteEventByID(id); } Assert.IsTrue(InsertCompleted); Assert.IsFalse(TestThrewException); }