public async Task NaoDeveLocalizarParaAtualizar() { var notificationContext = new NotificationContext(); var gameService = new GameApplicationService(notificationContext, _gameRepositoryMock.Object, _mapperMock.Object); await gameService.UpdateAsync(Guid.NewGuid(), new GameModel()); gameService.Valid.Should().BeFalse(); gameService.GetNotifications.Any(x => x.Message.Contains("")).Should().BeTrue(); }
public async Task DeveAtualizarMock() { _gameRepositoryMock.Setup(x => x.FindByIdAsync(It.IsAny <Guid>())) .Returns(Task.FromResult(new Game("1", "1"))); var notificationContext = new NotificationContext(); var gameService = new GameApplicationService(notificationContext, _gameRepositoryMock.Object, _mapperMock.Object); await gameService.UpdateAsync(Guid.NewGuid(), new GameModel { Name = "1", Gender = "1" }); gameService.Valid.Should().BeTrue(); gameService.GetNotifications.Count.Should().Be(0); }
public ViewModel() { appService_ = new GameApplicationService(); appService_.JoinEvent += (_, e) => System.Console.WriteLine($"{e.JoinReq.Name} joined."); }
public GameController(GameApplicationService app) { _app = app; }