Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
553 B
1
Indexable
Never
  public async void TestAsync2()
        {
            var mockRepo = new Mock<IRecipieRepositary>();
            int id = 1;
            mockRepo.Setup(x => x.GetAllDishById(id)).ReturnsAsync(AddNewItem1(id));
            var contoller = new RecipesController(mockRepo.Object);

            ResponseDTO responseDTO = new ResponseDTO();
            responseDTO = (ResponseDTO)await contoller.GetbyID(id);
            IEnumerable<Recipie> rec = (IEnumerable<Recipie>)responseDTO.Result;
            Assert.Equal(2, rec.ToList<Recipie>().Count);
Leave a Comment