static void Main(string[] args) { //IDataService dataService = new CsvDataService(); IDataService dataService = new XmlDataService(DataSettings.dataFilePath); CharacterBLL characterBLL = new CharacterBLL(dataService); Presenter presenter = new Presenter(characterBLL); }
public void CharacterModificationTestCON() { // arrange MeaningfulCalc calc = new MeaningfulCalc(); CharacterBLL dude = new CharacterBLL(); dude.StrengthScore = 10; dude.DexterityScore = 10; dude.ConstitutionScore = 10; dude.IntelligenceScore = 10; dude.WisdomScore = 10; dude.CharismaScore = 10; List <Modifier> listMods = new List <Modifier>(); Modifier mod = new Modifier(); mod.StatID = 8; mod.ModifierAmount = 2; listMods.Add(mod); var expected = 12; // act calc.CharacterModification(dude, listMods); var actual = dude.ConstitutionScore; // assert Assert.AreEqual(expected, actual); }
public ActionResult Create() { CharacterBLL defcharacter = new CharacterBLL(); defcharacter.CharacterID = 0; return(View(defcharacter)); }
static void Main(string[] args) { //IDataService dataService = new CsvDataService(); //IDataService dataService = new XmlDataService(); IDataService dataService = new JsonDataService(); CharacterBLL characterBLL = new CharacterBLL(dataService); Presenter presenter = new Presenter(characterBLL); }
static void Main(string[] args) { IDataService dataService = new MongoDBDataService(); // // Required to test the MongoDB data service // refresh MongoDB collection // dataService.WriteAll(GenerateListOfPeople()); CharacterBLL characterBLL = new CharacterBLL(dataService); Presenter presenter = new Presenter(characterBLL); }
public ActionResult Index(CharacterGeneratorModel defcharacter) { using (ContextBLL ctx = new ContextBLL()) { CharacterBLL temp = defcharacter.BaseCharacter; var RaceModifiers = ctx.GetRaceModifiersRelatedToRaces(defcharacter.RaceID, 0, 100); var ClassModifiers = ctx.GetClassModifiersRelatedToClasses(defcharacter.ClassID, 0, 100); //this is my meaningful calculation ctx.CharacterModification(temp, RaceModifiers); ctx.CharacterModification(temp, ClassModifiers); defcharacter.ModifiedCharacter = temp; defcharacter.CharacterName = " "; var races = ctx.GetRaces(0, 100); var classes = ctx.GetClasses(0, 100); SelectListItem blank = new SelectListItem(); blank.Value = "0"; blank.Text = " "; List <SelectListItem> RaceItems = new List <SelectListItem>(); RaceItems.Add(blank); foreach (RaceBLL race in races) { SelectListItem item = new SelectListItem(); item.Value = race.RaceID.ToString(); item.Text = race.RaceName; RaceItems.Add(item); } List <SelectListItem> ClassItems = new List <SelectListItem>(); ClassItems.Add(blank); foreach (ClassBLL @class in classes) { SelectListItem item = new SelectListItem(); item.Value = @class.ClassID.ToString(); item.Text = @class.ClassName; ClassItems.Add(item); } defcharacter.ClassNames = ClassItems; defcharacter.RaceNames = RaceItems; //defcharacter.ModifiedCharacter.CharacterName = defcharacter.CharacterName; //defcharacter.ModifiedCharacter.RaceID = defcharacter.RaceID; //defcharacter.ModifiedCharacter.ClassID = defcharacter.ClassID; return(View("Preview", defcharacter)); } }
public ActionResult Create(CharacterBLL collection) { try { // TODO: Add insert logic here using (ContextBLL ctx = new ContextBLL()) { ctx.CreateCharacter(collection); } return(RedirectToAction("MyIndex")); } catch (Exception ex) { ViewBag.Exception = ex; return(View("Error")); } }
static void Main(string[] args) { IDataService DataService; CharacterBLL CharacterBLL; Presenter presenter; DataService = new CsvDataService(@"Data/Data.csv"); CharacterBLL = new CharacterBLL(DataService); presenter = new Presenter(CharacterBLL); DataService = new XmlDataService(@"Data/Data.xml"); CharacterBLL = new CharacterBLL(DataService); presenter = new Presenter(CharacterBLL); DataService = new JsonDataService(); CharacterBLL = new CharacterBLL(DataService); presenter = new Presenter(CharacterBLL); }
static void Main(string[] args) { IDataService dataService; CharacterBLL characterBLL; Presenter presenter; // Run CSV Serializer dataService = new CsvDataService(); characterBLL = new CharacterBLL(dataService); presenter = new Presenter(characterBLL); // Run XML Serializer dataService = new XmlDataService(); characterBLL = new CharacterBLL(dataService); presenter = new Presenter(characterBLL); // Run JSON Serializer dataService = new JsonDataService(); characterBLL = new CharacterBLL(dataService); presenter = new Presenter(characterBLL); }
static void Main(string[] args) { ICharacterRepository characterRepository = new MongoDbCharacterRepository(); // // use seed data to test the MongoDB data service // //dataService.WriteAll(GenerateListOfCharacters(), out MongoDbStatusCode statusCode); //if (statusCode == MongoDbStatusCode.GOOD) //{ // CharacterBLL characterBLL = new CharacterBLL(dataService); // Presenter presenter = new Presenter(characterBLL); //} //else //{ // Console.WriteLine("There was an error connecting to data file."); //} // // application startup // CharacterBLL characterBLL = new CharacterBLL(characterRepository); Presenter presenter = new Presenter(characterBLL); }
//static OtherCharacterBLL _otherCharactersBLL; public Presenter(CharacterBLL characterBLL /*, OtherCharacterBLL otherCharacterBLL*/) { _charactersBLL = characterBLL; //_otherCharactersBLL = otherCharacterBLL; ManageApplicationLoop(); }
public Presenter(CharacterBLL characterBLL) { _charactersBLL = characterBLL; ManageApplicationLoop(); }
/// <summary> /// Constructor for the presenter class /// </summary> /// <param name="characterBll"></param> public Presenter(CharacterBLL characterBll) { _characterBLL = characterBll; ManageAppLoop(); }