예제 #1
0
        public void Should_Validate_Orion()
        {
            //arrange
            string division = "orion publishing group";

            //act
            var validated = Divisions.OneOf(division);

            //assert
            Assert.True(validated, $"Assert failed for {division} ");
        }
예제 #2
0
        /// <summary>
        /// Add a division to be be included in filterByDivisions parameter.
        /// </summary>
        /// <param name="division"></param>
        /// <returns>
        /// boolean: If the addition was successful or not.
        /// <see cref="ValidationAddStatus"/> : Determines why the operation failed.false
        /// </returns>
        public (bool, ValidationAddStatus) AddDivision(string division)
        {
            if (string.IsNullOrEmpty(division))
            {
                return(false, ValidationAddStatus.FailedEmptyValue);
            }

            var validated = Divisions.OneOf(division);

            if (!validated)
            {
                return(false, ValidationAddStatus.FailedValueUnknown);
            }

            var added = this.filterByDivisions.Add(division);

            if (!added)
            {
                return(false, ValidationAddStatus.FailedDuplicateValue);
            }

            return(true, ValidationAddStatus.Success);
        }