public async void DeleteStoreWithIncorrectIdWillReturnNotFound() { var mapper = Helper.CreateMapperWithProfile <StoreProfile>(); var store = CreateRandomStore(); var mock = new Mock <IStoreRepository>(); var service = new StoreService(mock.Object, mapper); var controller = new StoresController(service); var response = await controller.DeleteById(store.StoreId); Assert.IsType <NotFoundResult>(response.Result); }
public async void UserCanDeleteStoreById() { var store = CreateRandomStore(); var mock = new Mock <IStoreService>(); mock.Setup(x => x.FindByIdAsync(store.StoreId)).ReturnsAsync(store); var controller = new StoresController(mock.Object); var response = await controller.DeleteById(store.StoreId); Assert.IsType <OkObjectResult>(response.Result); }