public async Task CheckIfOwnerOfBook_WhenBookIdHasValueAndSubscriptionIdIsNull_ShouldReturnTrue() { //arrange var expectedData = new List <UserBook> { new UserBook { BookId = Guid.Parse("484c2b84-2644-4b55-8f64-27d643286b7a"), SubscriptionId = null, UserId = Guid.Parse("a7ec27ee-ac75-47f3-b4b9-9e76bcdc9c39") } }; _bookUSerSubscriptionService.Setup(x => x.QueryAsync(It.IsAny <Expression <Func <UserBook, bool> > >(), It.IsAny <string[]>())).ReturnsAsync(expectedData); // Act var result = await _bookController.CheckIfOwnerOfBook(It.IsAny <Guid>()) as ObjectResult; //assert Assert.That(result.Value, Is.True); }