public void SetUp()
            {
                var settings = new MapSettings();

                playerRepository = new Mock <IPlayerRepository>();
                players          = new List <Player> {
                    new Player {
                        Name = "Gimli", X = 0, Y = 0, IsIt = false
                    },
                    new Player {
                        Name = "Darth Vader", X = 10, Y = 10, IsIt = true
                    },
                    new Player {
                        Name = "Gandalf", X = 25, Y = 29, IsIt = false
                    },
                    new Player {
                        Name = "Frodo", X = 25, Y = 0, IsIt = false
                    }
                };
                playerRepository.Setup(x => x.GetAllPlayers()).Returns(players);
                ClassUnderTest = new MapImageBuilder(playerRepository.Object, settings);
                var imageBytes = ClassUnderTest.BuildImage();

                image = new MagickImage(imageBytes, MagickFormat.Png);
            }
Exemplo n.º 2
0
 public IActionResult Get()
 {
     return(File(mapImageBuilder.BuildImage(), "image/png"));
 }