public void GetPlates_ReturnPlatesFound() { // Arrage int processed = 0; var clientId = 810; var plateSpected = PlateServiceData.GetListPlateWithThreeElements(); plateByClientRepository.GetPlatesByClient(Arg.Any <int>()).Returns(plateSpected); plateByClientRepository.When(fx => fx.GetPlatesByClient(Arg.Any <int>())).Do(fx => ++ processed); // Act var plateSpectedTask = plateService.GetPlatesByClientAsync(clientId); plateSpectedTask.Wait(); // Assert Assert.IsNotNull(plateSpectedTask); Assert.IsTrue(plateSpectedTask.Status == TaskStatus.RanToCompletion); Assert.IsNotNull(plateSpectedTask.Result); Assert.AreEqual(3, plateSpectedTask.Result.Count); Assert.AreEqual(1, processed); }