示例#1
0
        /// <summary>
        /// Returns the requirement for the specified dropdown to be relevant.
        /// </summary>
        /// <param name="id">
        /// The dropdown identity.
        /// </param>
        /// <returns>
        /// The requirement for the specified dropdown to be relevant.
        /// </returns>
        private static IRequirement GetRequirement(DropdownID id)
        {
            switch (id)
            {
            case DropdownID.LumberjackCave:
            case DropdownID.ForestHideout:
            case DropdownID.CastleSecret:
            case DropdownID.TheWell:
            case DropdownID.MagicBat:
            case DropdownID.SanctuaryGrave:
            case DropdownID.HoulihanHole:
            case DropdownID.GanonHole:
            {
                return(RequirementDictionary.Instance[RequirementType.EntranceShuffleAllInsanity]);
            }

            case DropdownID.SWNEHole:
            case DropdownID.SWNWHole:
            case DropdownID.SWSEHole:
            case DropdownID.SWSWHole:
            {
                return(RequirementDictionary.Instance[RequirementType.EntranceShuffleInsanity]);
            }
            }

            throw new ArgumentOutOfRangeException(nameof(id));
        }
示例#2
0
        public void ClickDropdownOption_OptionId_SelectsOptionIdFromTheDropdownList(
            DropdownID dropdownID)
        {
            _sut.DropdownPage.NavigateToPage();

            _sut.DropdownPage.ClickDropdownOption(dropdownID);
            var result = _sut.DropdownPage.ReadDropdownText();

            Assert.That(result, Is.EqualTo("Option " + (int)dropdownID));
        }
        public IDropdown this[DropdownID key]
        {
            get
            {
                if (!ContainsKey(key))
                {
                    Create(key);
                }

                return(_dictionary[key]);
            }
            set => _dictionary[key] = value;
        public void ClickDropdownOption(DropdownID dropdownID)
        {
            switch (dropdownID)
            {
            case DropdownID.Option1:
                DropdownOption1.Click();
                break;

            case DropdownID.Option2:
                DropdownOption2.Click();
                break;
            }
        }
示例#5
0
        public void Dictionary_Tests(
            ModeSaveData modeData, DropdownID id, bool expected)
        {
            var container = ContainerConfig.Configure();

            using var scope = container.BeginLifetimeScope();
            var mode      = scope.Resolve <IMode>();
            var dropdowns = scope.Resolve <IDropdownDictionary>();
            var dropdown  = dropdowns[id];

            mode.Load(modeData);

            Assert.Equal(expected, dropdown.RequirementMet);
        }
示例#6
0
        public void Factory_Tests(
            ModeSaveData modeData, DropdownID id, bool expected)
        {
            var container = ContainerConfig.Configure();

            using var scope = container.BeginLifetimeScope();
            var mode     = scope.Resolve <IMode>();
            var factory  = scope.Resolve <IDropdownFactory>();
            var dropdown = factory.GetDropdown(id);

            mode.Load(modeData);

            Assert.Equal(expected, dropdown.RequirementMet);
        }
 /// <summary>
 /// Returns a new dropdown icon ViewModel instance for the specified ID.
 /// </summary>
 /// <param name="id">
 /// The dropdown ID.
 /// </param>
 /// <returns>
 /// A new dropdown icon ViewModel instance.
 /// </returns>
 private IDropdownVM GetDropdownVM(DropdownID id)
 {
     return(_factory(_dropdownDictionary[id], GetBaseImageSource(id)));
 }
 /// <summary>
 /// Returns the base image source string for the specified ID.
 /// </summary>
 /// <param name="id">
 /// The dropdown ID.
 /// </param>
 /// <returns>
 /// The base image source string.
 /// </returns>
 private static string GetBaseImageSource(DropdownID id)
 {
     return($"avares://OpenTracker/Assets/Images/Dropdowns/{id.ToString().ToLowerInvariant()}");
 }
示例#9
0
 /// <summary>
 /// Returns a new dropdown instance for the specified ID.
 /// </summary>
 /// <param name="id">
 /// The dropdown ID.
 /// </param>
 /// <returns>
 /// A new dropdown instance for the specified ID.
 /// </returns>
 public static IDropdown GetDropdown(DropdownID id)
 {
     return(new Dropdown(GetRequirement(id)));
 }
示例#10
0
 /// <summary>
 /// Returns a new dropdown icon ViewModel instance for the specified ID.
 /// </summary>
 /// <param name="id">
 /// The dropdown ID.
 /// </param>
 /// <returns>
 /// A new dropdown icon ViewModel instance.
 /// </returns>
 private static DropdownVM GetDropdownVM(DropdownID id)
 {
     return(new DropdownVM(GetBaseImageSource(id), DropdownDictionary.Instance[id]));
 }
示例#11
0
 /// <summary>
 /// Returns a new dropdown for the given ID.
 /// </summary>
 /// <param name="id">
 /// The dropdown ID
 /// </param>
 /// <returns>
 /// A new dropdown.
 /// </returns>
 public IDropdown GetDropdown(DropdownID id)
 {
     return(_factory(GetRequirement(id)));
 }