public void SetUp()
 {
     player = new Player
     {
         Active = false,
         Id = 123,
         Name = "the name",
         GamingGroupId = 789
     };
     actualModel = new PlayerEditViewModelBuilder().Build(player);
 }
Ejemplo n.º 2
0
 public virtual ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     PlayerDetails player;
     try
     {
         player = playerRetriever.GetPlayerDetails(id.Value, 0);
     }
     catch (UnauthorizedAccessException)
     {
         return new HttpStatusCodeResult(HttpStatusCode.Unauthorized);
     }
     catch (KeyNotFoundException)
     {
         return new HttpStatusCodeResult(HttpStatusCode.NotFound);
     }
     var playerEditViewModel = new PlayerEditViewModel
     {
         Active = player.Active,
         Id = player.Id,
         GamingGroupId = player.GamingGroupId,
         Name = player.Name,
         IsDeleteable = !player.PlayerGameSummaries.Any() && string.IsNullOrEmpty(player.ApplicationUserId)
     };
     return View(MVC.Player.Views.Edit, playerEditViewModel);
 }