public void 時間経過() { var p1 = new Participant("A", 1000); _keeper.AddMenber(p1); _clock.SetNow(DateTime.Parse("2011/1/1 00:00:00")); _keeper.Start(); _clock.SetNow(DateTime.Parse("2011/1/1 01:00:00")); _keeper.Notify(); Assert.That(p1.CostPerHour, Is.EqualTo(1000)); Assert.That(_keeper.TotalCost, Is.EqualTo(1000)); }
public MainWindowViewModel() { _keeper = new TimeKeeper(new Clock()); _timer = new Timer(x => { _keeper.Notify(); TotalCost = _keeper.TotalCost; }, null, -1, _interval * 1000); }