Exemple #1
0
 public ViewResult Index()
 {
     _tracker.Add("Home.Index");
     ViewData["PageCount"] = _pageCounter.Count();
     ViewData["Tracks"]    = _tracker.Display();
     return(View(_bda.Books));
 }
Exemple #2
0
 public LinkFrequency <TLink> IncrementFrequency(ref Doublet <TLink> doublet)
 {
     if (_doubletsCache.TryGetValue(doublet, out LinkFrequency <TLink> data))
     {
         data.IncrementFrequency();
     }
     else
     {
         var link = _links.SearchOrDefault(doublet.Source, doublet.Target);
         data = new LinkFrequency <TLink>(_one, link);
         if (!_equalityComparer.Equals(link, default))
         {
             data.Frequency = Arithmetic.Add(data.Frequency, _frequencyCounter.Count(link));
         }
         _doubletsCache.Add(doublet, data);
     }
     return(data);
 }
Exemple #3
0
        public ServiceUnavailableMockModule(ICounter counter)
        {
            Post(BasePath + "first", x => {
                counter.Bump(1);
                if (counter.Count(1) > 1)
                {
                    return(success("first"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });

            Post(BasePath + "second", x => {
                counter.Bump(2);
                if (counter.Count(2) > 2)
                {
                    return(success("second"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });

            Post(BasePath + "third", x => {
                counter.Bump(3);
                if (counter.Count(3) > 3)
                {
                    return(success("third"));
                }
                else
                {
                    return(serviceUnavailable());
                }
            });
        }
Exemple #4
0
        //[InlineData("data/crossing.txt", 275115831438)] // 重すぎるのでコメントアウト
        public void Count(string filePath, long expected)
        {
            var actual = _counter.Count(filePath);

            Assert.Equal(expected, actual);
        }
Exemple #5
0
 public IActionResult Increase()
 {
     count.Count();
     return(RedirectToAction("Counter"));
 }
Exemple #6
0
 public int Count(string input)
 {
     return(_delegator.Count(input));
 }