public async Task CreatePrivateChat_ShouldBeDoneSuccessfully() { // Arrange _unitOfWorkMock.Setup(x => x.Chats.CreatePrivateChat(It.IsAny <int>(), It.IsAny <int>())) .ReturnsAsync(new KeyValuePair <bool, string>(true, It.IsAny <string>())); _unitOfWorkMock.Setup(x => x.Complete()) .Verifiable(); // Act var result = await _sut.CreatePrivateChat(It.IsAny <int>(), It.IsAny <int>()); // Assert Assert.True(result.Key); }
public async Task <IActionResult> CreatePrivateChat(int userId) { int loggedInUserId = int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value); return(Ok(await _chatsService.CreatePrivateChat(userId, loggedInUserId))); }