public async Task Test_EditBrand_ShouldEditSuccessfully() { //arrange var brandForEdit = new Brand { Id = 1, Name = "Test Brand" }; var resultModel = new BrandUpdatedDto() { IsSuccess = true }; brandRepositoryMock.Setup(p => p.UpdateBrand(brandForEdit)).Returns(Task.FromResult(resultModel)); //act var result = await subject.EditBrand(brandForEdit); var OkActionResult = result as OkResult; //assert Assert.IsInstanceOf <OkResult>(OkActionResult); brandRepositoryMock.Verify(x => x.UpdateBrand(brandForEdit), Times.Once); }