public void SendGroupMessageAsync_GroupDoesNotExists_ThrowsItemNotFoundException() { var chatId = Guid.NewGuid().ToString(); var messageData = new MessageDataModel() { Text = "This is a test message!" }; _unitOfWork.Setup(u => u.Chats.GetByIdAsync(It.IsAny <string>())).ReturnsAsync((Chat)null); _messagesService.Awaiting(s => s.SendGroupMessageAsync(chatId, messageData)) .Should().Throw <ItemNotFoundException>(); }