public void TestAddOfferRequest()
        {
            var          service   = new OfferRequestService(carpentryWebsiteContext);
            OfferRequest itemToAdd = new OfferRequest {
                OfferRequestId = 105, Name = "New name", EmailAddress = "New email", Message = "New message"
            };

            service.AddOfferRequest(itemToAdd, null, "false");
            OfferRequest result = service.GetOfferRequestDetails(105);

            Assert.Equal(itemToAdd, result);
        }
        public void TestEditOfferRequests()
        {
            string       expectedName = "Different name";
            var          service      = new OfferRequestService(carpentryWebsiteContext);
            OfferRequest itemToAdd    = new OfferRequest {
                OfferRequestId = 17, Name = "New name", EmailAddress = "New email", Message = "New message"
            };

            service.AddOfferRequest(itemToAdd, null, "false");
            carpentryWebsiteContext.Entry(service.GetOfferRequestDetails(17)).State = EntityState.Detached;

            service.UpdateOfferRequest(new OfferRequest {
                OfferRequestId = 17, Name = "Different name", EmailAddress = "Different email", Message = "Different message"
            });
            OfferRequest result = service.GetOfferRequestDetails(17);

            Assert.Equal(expectedName, result.Name);
        }
        public int Create(IFormFile image, string imageAdded, string name, string emailAddress, string message)
        {
            OfferRequest offerRequest = new OfferRequest(name, emailAddress, message);

            return(offerRequestService.AddOfferRequest(offerRequest, image, imageAdded));
        }