public given()
        {
            _properties = new Dictionary <string, object>();
            _properties.Add("arbitrary", "member for testing");

            _sut = new RecordKeeper(_properties);

            _sut.Save(new ExerciseScored
            {
                ExerciseId = 1,
                InstanceId = Guid.NewGuid(),
                Score      = 5,
                Timestamp  = _dayOne
            });

            _sut.Save(new ExerciseScored
            {
                ExerciseId = 2,
                InstanceId = Guid.NewGuid(),
                Score      = 5,
                Timestamp  = _dayOne
            });
            _sut.Save(new ExerciseScored
            {
                ExerciseId = 2,
                InstanceId = Guid.NewGuid(),
                Score      = 10,
                Timestamp  = _dayTwo
            });
            _sut.Save(new ExerciseScored
            {
                ExerciseId = 2,
                InstanceId = Guid.NewGuid(),
                Score      = 7,
                Timestamp  = _dayThree
            });
            _sut.Save(new ExerciseScored
            {
                ExerciseId = 2,
                InstanceId = Guid.NewGuid(),
                Score      = 2,
                Timestamp  = _dayFour
            });
        }
Exemplo n.º 2
0
        public static void Handle(WorkoutEvent @event)
        {
            switch (@event)
            {
            case WorkoutStarted e:
                WorkoutState.Save(e);
                Scorecard.Save(e);
                break;

            case ExerciseScored e:
                WorkoutState.Save(e);
                Scorecard.Save(e);
                TopScores.Save(e);
                break;

            case WorkoutCompleted e:
                WorkoutState.Save(e);
                Scorecard.Save(e);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }