Beispiel #1
0
        /// <summary>
        /// Helper method to assert if any items have been added to option&apos;s given directly
        /// by name and group
        /// </summary>
        /// <param name="name"></param>
        /// <param name="groupName"></param>
        /// <returns></returns>
        public bool AnyGivenDirectlyOfNameAndGroup(string name, string groupName)
        {
            const StringComparison OPT = StringComparison.OrdinalIgnoreCase;

            return(GivenDirectly.Any(g =>
                                     string.Equals(g.Item1.Name, name, OPT) && string.Equals(g.Item1.GetName(KindsOfNames.Group), groupName, OPT)));
        }
Beispiel #2
0
 /// <summary>
 /// Helper method to assert if any option&apos;s given directly have group name <see cref="groupName"/>
 /// </summary>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public bool AnyGivenDirectlyOfGroupName(string groupName)
 {
     return(GivenDirectly.Any(x => x.Item1.AnyNames((k, v) => k == KindsOfNames.Group && v == groupName)));
 }
Beispiel #3
0
        /// <summary>
        /// Helper method to assert if any items have been added to option&apos;s given directly
        /// with the given name
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool AnyGivenDirectlyOfName(string name)
        {
            const StringComparison OPT = StringComparison.OrdinalIgnoreCase;

            return(GivenDirectly.Any(g => string.Equals(g.Item1.Name, name, OPT)));
        }
Beispiel #4
0
 /// <summary>
 /// Asserts if any given-directly items have been added.
 /// </summary>
 /// <returns></returns>
 public bool AnyGivenDirectly()
 {
     return(GivenDirectly.Any());
 }
Beispiel #5
0
 /// <summary>
 /// Same as its overload, just without a group name
 /// </summary>
 public virtual void AddGivenDirectly(string name, double?amount = null)
 {
     GivenDirectly.Add(new Tuple <VocaBase, double>(new VocaBase(name), amount ?? 0D));
 }
Beispiel #6
0
 /// <summary>
 /// Add item which will be given zero portion.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="groupName"></param>
 public virtual void AddZeroPortion(string name, string groupName)
 {
     GivenDirectly.Add(new Tuple <VocaBase, double>(new VocaBase(name, groupName), 0D));
 }