public void BadgesTestsArrange() { _badgeDictionary = new BadgeRepo(); _entry1 = new Badge(new List <string>() { "Hodoor", "The Doors of Durin", "The Silver Door" }); _entry2 = new Badge(new List <string>() { "The Forgotten Door", "A Wind in the Door", "The Door into Summer" }); _badgeDictionary.AddBadgeToDictionary(_entry1); _badgeDictionary.AddBadgeToDictionary(_entry2); }
public void AddBadge() { _repo.Seed(); _repo.AddBadgeToDictionary(112); Assert.IsTrue((_repo.GetListOfBadges()).ContainsKey(112)); }
private void SeedData() { var alexanderKey = new Badge(new List <string>() { "The Forgotten Door" }); var robertHeinlein = new Badge(new List <string>() { "The Door into Summer" }); var georgeMartin = new Badge(new List <string>() { "Hodoor" }); var madelineLengle = new Badge(new List <string>() { "A Wind in the Door" }); var epicFantasy = new Badge(new List <string>() { "Hodoor", "The Doors of Durin", "The Silver Door" }); var scienceFiction = new Badge(new List <string>() { "The Forgotten Door", "A Wind in the Door", "The Door into Summer" }); _badgeDictionary.AddBadgeToDictionary(alexanderKey); _badgeDictionary.AddBadgeToDictionary(robertHeinlein); _badgeDictionary.AddBadgeToDictionary(georgeMartin); _badgeDictionary.AddBadgeToDictionary(madelineLengle); _badgeDictionary.AddBadgeToDictionary(epicFantasy); _badgeDictionary.AddBadgeToDictionary(scienceFiction); }
// ADD A Badge private void AddABadge() { Badge newItem = new Badge(); List <string> door = new List <string>(); Console.Clear(); Console.WriteLine("What is the number on the badge:"); string starAsIntiger = Console.ReadLine(); newItem.BadgeID = int.Parse(starAsIntiger); bool keepRunning = true; while (keepRunning == true) { Console.WriteLine("List a door that it needs access to:"); string nextDoor = Console.ReadLine(); door.Add(nextDoor); newItem.DoorNames = door; Console.WriteLine("Any other doors(yes / no) ?"); string dealYes = Console.ReadLine(); if (dealYes == "yes") { keepRunning = true; } else { keepRunning = false; } } _DicofBadge.Add(newItem.BadgeID, newItem); _itemRepo.AddBadgeToDictionary(newItem); Console.ReadKey(); }
public void AddBadge() { Console.WriteLine("What is the number on the badge:"); string badgeIdAsString = Console.ReadLine(); int badgeID = int.Parse(badgeIdAsString); _badgeRepo.AddBadgeToDictionary(badgeID); RoomAdd(badgeID); }
public void Arrange() { _repo = new BadgeRepo(); _content = new Badge(27384, new List <string> { "A2,", "B5,", "c4" }); _repo.AddBadgeToDictionary(_content.BadgeID, _content); }
public void AddNewBadge() { Console.Clear(); Console.WriteLine("What is the number on the badge:"); double newBadgeID = Convert.ToDouble(Console.ReadLine()); List <Door> doorList = WhileList(); _repo.AddBadgeToDictionary(newBadgeID, doorList); }
public void TestForAddingBadge() { var entry3 = new Badge(new List <string>() { "Hodoor" }); int initail = _badgeDictionary.GetAllBadges().Count; _badgeDictionary.AddBadgeToDictionary(entry3); int final = _badgeDictionary.GetAllBadges().Count; Assert.AreNotEqual(initail, final); }
public void AddBadge() { Console.Clear(); Badge newBadge = new Badge(); Console.WriteLine("Enter the new 5-digit badge number:"); string badgeIdAsString = Console.ReadLine(); int badgeIdAsInt = int.Parse(badgeIdAsString); newBadge.BadgeID = badgeIdAsInt; Console.WriteLine("\nList a door this badge will have access to:\n"); string accessAsString = Console.ReadLine(); newBadge.DoorNames.Add(accessAsString); Console.WriteLine("Any other doors: (y/n)\n"); string moreDoors = Console.ReadLine().ToLower(); while (moreDoors == "y") { Console.WriteLine("List a door this badge will have access to:\n"); string anotherAccessAsString = Console.ReadLine(); newBadge.DoorNames.Add(anotherAccessAsString); Console.WriteLine("Any other doors: (y/n)\n"); string evenMoreDoors = Console.ReadLine().ToLower(); if (evenMoreDoors != "y") { break; } } _badges.AddBadgeToDictionary(newBadge.BadgeID, newBadge); }
public void AddBadgeToDictionary_ShouldGetNotNull() { // Arrange --> Setting up the playing field Badge content = new Badge(); content.BadgeID = 27384; BadgeRepo repository = new BadgeRepo(); // Act --> Get/Run the we want to test repository.AddBadgeToDictionary(_content.BadgeID, _content); Badge contentFromDictionary = repository.GetBadgeByKeyValue(27384); // Assert --> Use the assert class to verify the expected outcome Assert.IsNotNull(contentFromDictionary); }