public void ItemTypeEnumHelperTests_GetImageURIFromItemType_Unknown_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.Unknown);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypeDefaultImageURI, result);
        }
        public void ItemTypeEnumHelperTests_GetImageURIFromItemType_GraduationCapAndRobe_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.GraduationCapAndRobe);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypeGraduationCapAndRobeImageURI, result);
        }
        public void ItemTypeEnumHelperTests_GetImageURIFromItemType_FinancialAid_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.FinancialAid);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypeFinancialAidImageURI, result);
        }
        public void ItemTypeEnumHelperTests_GetImageURIFromItemType_PrivateTutor_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.PrivateTutor);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypePrivateTutorImageURI, result);
        }
        public void ItemTypeEnumHelperTests_GetImageURIFromItemType_Laptop_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.Laptop);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypeLaptopImageURI, result);
        }
        public void ItemTypeEnumHelperTests_GetImageURIFromItemType_Textbooks_Should_Pass()
        {
            // Arrange

            // Act
            var result = ItemTypeEnumHelper.GetImageURIFromItemType(ItemTypeEnum.Textbooks);

            // Reset

            // Assert
            Assert.AreEqual(Constants.ItemTypeTextbooksImageURI, result);
        }
        /// <summary>
        /// Get a Random Item for the Location. This method it particular to the Escaping School game flavor.
        ///
        /// Return the String for the ID
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public static string GetItemEscapingSchool(ItemLocationEnum location)
        {
            var ItemList = new List <ItemModel>();

            // Add None to the list
            ItemList.Add(new ItemModel {
                Id = null, Name = "None"
            });

            var itemtypes = ItemLocationEnumHelper.GetItemFromLocationType(location);

            if (itemtypes.Count == 0)
            {
                return(null);
            }

            foreach (var type in itemtypes)
            {
                ItemModel item = new ItemModel();
                item.Name        = ItemTypeEnumHelper.getRandomeNameBasedOnType(type);
                item.Description = ItemTypeEnumHelper.getDescriptionBasedOnType(type);
                item.ItemType    = type;
                item.Attribute   = AttributeEnum.Attack;
                item.Location    = location;
                item.ImageURI    = ItemTypeEnumHelper.GetImageURIFromItemType(type);
                item.Damage      = ItemTypeEnumHelper.GetDamageFromItemType(type);
                ItemList.Add(item);
            }

            var result = ItemList.First().Id;

            var index = DiceHelper.RollDice(1, ItemList.Count()) - 1;

            if (index < ItemList.Count)
            {
                result = ItemList.ElementAt(index).Id;
            }

            return(result);
        }
        /// <summary>
        /// Save by calling for Create
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public async void Save_Clicked(object sender, EventArgs e)
        {
            // if the name or description are not entered, the page remains on the create screen
            if (string.IsNullOrEmpty(ViewModel.Data.Name) || string.IsNullOrEmpty(ViewModel.Data.Description))
            {
                await Navigation.PushModalAsync(new NavigationPage(new ItemUpdatePage(ViewModel)));

                await Navigation.PopModalAsync();
            }
            // otherwise it creates and saves the new item
            else
            {
                var itemType     = ItemTypePicker.SelectedItem.ToString();
                var itemTypeEnum = ItemTypeEnumHelper.ConvertMessageStringToEnum(itemType);
                ViewModel.Data.ItemType = itemTypeEnum;
                ViewModel.Data.Damage   = ItemTypeEnumHelper.GetDamageFromItemType(itemTypeEnum);
                ViewModel.Data.ImageURI = ItemTypeEnumHelper.GetImageURIFromItemType(itemTypeEnum);
                ViewModel.Data.Location = ItemTypeEnumHelper.GetLocationFromItemType(itemTypeEnum);

                MessagingCenter.Send(this, "Create", ViewModel.Data);
                await Navigation.PopModalAsync();
            }
        }