public IFizzBuzzResult Calculate(IFizzBuzzNumber inputNumber) { StringBuilder sb = new StringBuilder(); if (new ModOperator(inputNumber, 5).Exact()) { new BuzzResult().Collect(sb); } if (new ModOperator(inputNumber, 3).Exact()) { return(new FizzResult()); } return(new NumberResult(inputNumber)); }
public NumberResult(IFizzBuzzNumber inputNumber) : base(inputNumber.AsString()) { }
public ModOperator(IFizzBuzzNumber inputNumber, int mod) { _inputNumber = inputNumber; _mod = mod; }