public ViewResult Index() { _tracker.Add("Home.Index"); ViewData["PageCount"] = _pageCounter.Count(); ViewData["Tracks"] = _tracker.Display(); return(View(_bda.Books)); }
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); }
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()); } }); }
//[InlineData("data/crossing.txt", 275115831438)] // 重すぎるのでコメントアウト public void Count(string filePath, long expected) { var actual = _counter.Count(filePath); Assert.Equal(expected, actual); }
public IActionResult Increase() { count.Count(); return(RedirectToAction("Counter")); }
public int Count(string input) { return(_delegator.Count(input)); }