Example #1
0
        public static List <PizzaDetailsViewModel> GetPizzaDetails()
        {
            List <PizzaDetailsViewModel> pizzaList = new List <PizzaDetailsViewModel>();
            PizzaDetailsViewModel        obj       = new PizzaDetailsViewModel()
            {
                VendorId      = 1,
                VendorName    = "Dominos",
                IsSelected    = true,
                isClosed      = false,
                OtherDiscount = 10,
                pizzaDetails  = SetUp.GetDetails()
            };

            pizzaList.Add(obj);
            return(pizzaList);
        }
Example #2
0
        public async Task PlaceOrder_ReturnsTrue_Test()
        {
            var orderMadeByUser = SetUp.GetPizzaDetails();

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

            var response = await StartUpInitializer.TestHttpClient.PostAsync("/Order", data);

            response.EnsureSuccessStatusCode();

            var result = await response.Content.ReadAsStringAsync();

            var isOrderPaced = JsonConvert.DeserializeObject <bool>(result);

            Assert.IsTrue(isOrderPaced);
        }