public async void TestEdit_InvalidRating_ShouldFail(string value)
        {
            // Arrange
            RatingsController controller = new RatingsController(_context);
            int userId = int.Parse(value);

            // Act
            Rating replayRating = await _context.Rating
                                  .FirstOrDefaultAsync(a => a.UserId == userId);

            replayRating.GameId = 0;

            try
            {
                var result = await controller.Edit(replayRating.GameId, Convert.ToInt16(rating.Rate));

                // Assert
                Assert.IsType <ViewResult>(result);
                ViewResult viewResult = (ViewResult)result;
                Assert.NotNull(viewResult.ViewData.ModelState);
                Assert.NotEmpty(viewResult.ViewData.ModelState.Keys);

                foreach (string item in viewResult.ViewData.ModelState.Keys)
                {
                    Assert.Equal("", item);
                }
            }
            catch (Exception ex)
            {
                Assert.Equal("System.NullReferenceException", ex.GetType().ToString());
            }
        }
        public void Delete_ErrorsWhenIdNotFound()
        {
            var data    = new List <Rating>();
            var mockSet = Mock.CreateMockSet(data);

            mockSet.Setup(m => m.Find(It.IsAny <object[]>()))
            .Returns <object[]>(ids => data.FirstOrDefault(d => d.User_Rating_ID == (int)ids[0]));
            var mockdb = new Mock <PlayerMatcherEntitiesExtended>();

            mockdb.Setup(db => db.Ratings).Returns(mockSet.Object);
            var controller = new RatingsController(mockdb.Object);

            var response = controller.Edit(1) as HttpStatusCodeResult;

            response.Should().BeOfType <HttpNotFoundResult>().Which.StatusCode.Should().Be((int)HttpStatusCode.NotFound);
        }