public void ShouldAddHighscoreToContextWhenAdding() { var highscore = new Highscore("Frank", Guid.NewGuid(), new QuestionResult()); _objectUnderTest.AddHighscore(highscore); _chineseTrainerContextMock.Verify(p => p.Add(highscore)); }
public void Initialize(Highscore currentHighscore) { CurrentHighscore = _scoreCalculator.CalculateScore(currentHighscore.QuestionResult); var allHighscores = _repository.GetAllHighscores(currentHighscore.DictionaryId); var highscoresForDictionary = GetOrderedHighscoresForDictionary(allHighscores, currentHighscore.DictionaryId); Highscores = GetBestAllTimeHighscores(highscoresForDictionary); PersonalBest = GetPersonalBest(highscoresForDictionary, currentHighscore.Username); }
public void Initialize() { _currentHighscore = CreateCurrentHighscore(); var highscores = new List<Highscore> { CreateHighscore("Frank", _testDictionary, 80), CreateHighscore("Myself", _testDictionary, 50), CreateHighscore("Sandra", _testDictionary, 40), CreateHighscore("Sandra", _testDictionary, 70), CreateHighscore("Myself", new Dictionary("dict2", null), 20), _currentHighscore, CreateHighscore("Frank", _testDictionary, 30), CreateHighscore("Frank", _testDictionary, 60) }; _repositoryMock = new Mock<IRepository>(); _repositoryMock.Setup(p => p.GetAllHighscores(_testDictionary.Id)).Returns(highscores); _objectUnderTest = new HighscoreVM(_repositoryMock.Object, new ScoreCalculator()); }
public void AddHighscore(Highscore highscore) { AddQuestionResult(highscore.QuestionResult); _chineseCharacterTrainerService.AddHighscore(highscore); }
private void RaiseUploadFinished(Highscore highScore) { var handler = UploadFinished; if (handler != null) handler(highScore); }
private void CompetitionSummaryVMUploadFinished(Highscore highscore) { _highscoreVM.Initialize(highscore); Content = _highscoreVM; }