Пример #1
0
 public void Setup()
 {
     min       = 1;
     max       = 20;
     fizzBuzz  = new FizzBuzz();
     strResult = "1 2 Lucky 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Lucky 14 FizzBuzz 16 17 Fizz 19 Buzz";
 }
Пример #2
0
        private static Task DoClientWork(IClusterClient client)
        {
            // example of calling grains from the initialized client
            IFizzBuzz fizzBuzz = client.GetGrain <IFizzBuzz>(0);

            const int numberOfCallsToMake = 10000;

            var valueList      = new (int testValue, int threadId, string evalulation)[numberOfCallsToMake];
Пример #3
0
 public void BeforeAll()
 {
     _ioc.Register<IFizzBuzz,FizzBuzz>();
     _sut = _ioc.Resolve<IFizzBuzz>();
     for (int i = 1; i <= 15; i++)
     {
         _result[i - 1] = _sut.Print();
     }
 }
    private static void CachedFizzBuzz(FizzBuzzSolver fb)
    {
        var fizzbuzzArray = new IFizzBuzz[fb.FizzBuzz];

        for (int i = 0; i < fb.FizzBuzz - 1; i++)
        {
            int s = i + 1;
            if (s % fb.Fizz == 0)
            {
                fizzbuzzArray[i] = new Fizz();
                Console.WriteLine("Fizz");
            }
            else
            if (s % fb.Buzz == 0)
            {
                fizzbuzzArray[i] = new Buzz();
                Console.WriteLine("Buzz");
            }
            else
            {
                fizzbuzzArray[i] = new NullFizzBuzz();
                Console.WriteLine(s);
            }
        }
        fizzbuzzArray[fb.FizzBuzz - 1] = new FizzBuzz();
        Console.WriteLine("FizzBuzz");
        NullFizzBuzz.value = fb.FizzBuzz;
        for (int j = 1; j < fb.Quotient; j++)
        {
            for (int i = 0; i < fb.FizzBuzz; i++)
            {
                NullFizzBuzz.value++;
                Console.WriteLine(fizzbuzzArray[i]);
            }
        }
        for (int i = 0; i < fb.Remainder; i++)
        {
            NullFizzBuzz.value++;
            Console.WriteLine(fizzbuzzArray[i]);
        }
    }
Пример #5
0
 public void LoadContext()
 {
     mockDay = new Mock <INameOfDay>();
     buzz    = new Buzz(mockDay.Object);
 }
Пример #6
0
 public Domain(IParser parser, IValidator validator, IFizzBuzz fizzBuzz)
 {
     _parser    = parser;
     _validator = validator;
     _fizzBuzz  = fizzBuzz;
 }
Пример #7
0
        public Task <string> GetFizzBuzz(int value)
        {
            IFizzBuzz fizzBuzz = _clusterClient.GetGrain <IFizzBuzz>(0);

            return(fizzBuzz.Evaluate(value));
        }
 public FizzBuzzController(IFizzBuzz fizzBuzz) => _fizzbuzz = fizzBuzz;
Пример #9
0
 public void Setup()
 {
     _fizzBuzz = new FizzBuzz();
 }
Пример #10
0
 public Player(IFizzBuzz fizzBuzz)
 {
     _fizzBuzz = fizzBuzz;
 }
Пример #11
0
 public DisplayFizz(IFizzBuzz fizzBuzzHandlerService)
 {
     _fizzBuzzHandler = fizzBuzzHandlerService;
 }
Пример #12
0
 public FizzBuzzController(IFizzBuzz fizzBuzz)
 {
     _fb = fizzBuzz;
 }
Пример #13
0
 public void Push(IFizzBuzz fizzbuzz)
 {
     _fizzbuzz.Add(fizzbuzz);
 }
Пример #14
0
 public FizzBuzzPrinter(ILinePrinter printer, IFizzBuzz fizzBuzz)
 {
     _printer  = printer;
     _fizzBuzz = fizzBuzz;
 }
Пример #15
0
 public FizzBuzzTest()
 {
     _stringWriter = new StringWriter(new StringBuilder());
     _fizzBuzz     = new FizzBuzz(_stringWriter);
 }