protected StringContent BaseRequest(PriceDeserializer priceDsl, string email)
        {
            var admin = Context.User.Include(e => e.Role).FirstOrDefault(e => e.Email == email);

            var newContent = new StringContent(
                JsonConvert.SerializeObject(priceDsl),
                Encoding.UTF8,
                "application/json"
                );

            HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",
                                                                                           TokenBearerHelper.GetTokenFor(admin, Context));

            return(newContent);
        }
            public async void ShouldNotBeAbleToSubscribeBeforeWindow(string eventName, string email)
            {
                var @event = Context.Event.FirstOrDefault(e => e.Title == eventName);
                var admin  = Context.User.Include(e => e.Role).FirstOrDefault(e => e.Email == email);
                var id     = @event.Id;

                HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", TokenBearerHelper.GetTokenFor(admin, Context));
                HttpResponseMessage body = await HttpClient.GetAsync($"api/booking/subscribe/{id}");

                Assert.Equal(HttpStatusCode.BadRequest, body.StatusCode);
            }
            public async void ShouldNullableValueForParentWhenNotFound(string email)
            {
                string nameAsGuid  = Guid.NewGuid().ToString().Substring(0, 20);
                var    categoryDsr = new CategoryDeserializer()
                {
                    Name = nameAsGuid, ParentCategory = int.MaxValue - 1
                };
                var admin = Context.User.Include(e => e.Role).FirstOrDefault(e => e.Email == email);

                var newContent = new StringContent(JsonConvert.SerializeObject(categoryDsr),
                                                   Encoding.UTF8, "application/json");

                HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",
                                                                                               TokenBearerHelper.GetTokenFor(admin, Context));
                HttpResponseMessage response = await HttpClient.PostAsync("api/category", newContent);

                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                Assert.True(Context.Category.Any(c => c.Name.Equals(nameAsGuid)));
            }
            private void MakeRequest(BookingValidationDeserializer dsl, User user, out StringContent content)
            {
                string json = JsonConvert.SerializeObject(dsl);

                content = new StringContent(json, Encoding.UTF8, "application/json");

                HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer",
                                                                                               TokenBearerHelper.GetTokenFor(user, Context));
            }