コード例 #1
0
ファイル: TimeKeeperTest.cs プロジェクト: nakaji/CostCounter
        public void 開始()
        {
            var p1 = new Participant("A", 1000);
            _keeper.AddMenber(p1);

            _clock.SetNow(DateTime.Parse("2011/1/1 00:00:00"));
            _keeper.Start();

            Assert.That(p1.StartTime, Is.EqualTo(_clock.Now));
            Assert.That(_keeper.IsRunning, Is.True);
        }
コード例 #2
0
ファイル: TimeKeeperTest.cs プロジェクト: nakaji/CostCounter
        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));
        }
コード例 #3
0
 public void AddMenber(Participant participant)
 {
     _participants.Add(participant);
 }
コード例 #4
0
ファイル: TimeKeeper.cs プロジェクト: nakaji/CostCounter
 public void AddMenber(Participant participant)
 {
     _participants.Add(participant);
 }
コード例 #5
0
ファイル: ParticipantTest.cs プロジェクト: nakaji/CostCounter
 public void SetUp()
 {
     _participant = new Participant("name", 5000);
     Assert.That(_participant.Name, Is.EqualTo("name"));
     Assert.That(_participant.CostPerHour, Is.EqualTo(5000));
 }