public async void DataHasPointsForPlayers()
        {
            // Arrange
            var data = await sut.GetGameData();

            // Act
            int actualCount = data.Players.Where(item => item.fppg == null).Count();

            // Assert
            Assert.True(actualCount == 0, "Every player has points");
        }
Example #2
0
        public async void BeforeAnyTestStarted()
        {
            // Perform setup here?
            GameDataService dataService = new GameDataService();

            // Workaround for http async testing...
            var data = Task.Run(() => dataService.GetGameData()).Result;

            // Setup Guessing Game with data
            sut = new GuessGame(data);
        }
        async void Initialize()
        {
            UIActivityIndicatorView activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);

            activitySpinner.Frame = new CGRect(new CGPoint(View.Center.X - 50, View.Center.Y - 50), new CGSize(100, 100));
            activitySpinner.StartAnimating();

            View.Add(activitySpinner);

            GameDataService dataService = new GameDataService();
            var             gameData    = await dataService.GetGameData();

            Game = new GuessGame(gameData);

            PlayerViews = Game.GetRandomPlayers();

            Add2PlayerViews();
            AddScoreView();

            // We have data, stop showing spinner
            activitySpinner.StopAnimating();
            activitySpinner.RemoveFromSuperview();
        }