示例#1
0
        public FizzBuzzResult GetResult(int value)
        {
            var retval = new FizzBuzzResult() { Value = value};
            StringBuilder sb = new StringBuilder();
            foreach (var store in storage)
            {
                if (store.BitArray[value])
                    sb.Append(store.Config.Text + " ");
            }

            retval.Result = sb.Length == 0 ? value.ToString() : sb.ToString().TrimEnd();
            return retval;
        }
示例#2
0
        public FizzBuzzResult GetResult(int value)
        {
            var retval = new FizzBuzzResult()
            {
                Value = value
            };
            StringBuilder sb = new StringBuilder();

            foreach (var store in storage)
            {
                if (store.BitArray[value])
                {
                    sb.Append(store.Config.Text + " ");
                }
            }

            retval.Result = sb.Length == 0 ? value.ToString() : sb.ToString().TrimEnd();
            return(retval);
        }