Esempio n. 1
0
        public async Task WorkFlowTests()
        {
            //Arrange CREATE
            var orderModel = _fixture.Create <OrderModel>();
            var createdId  = orderModel.Id;

            //Act   CREATE
            var retrunModel = await _client.CreateOrder(orderModel);

            //Assert CREATE
            Assert.AreNotEqual(createdId, retrunModel.Id);

            //Act GET
            var order = await _client.GetOrder(retrunModel.Id);

            //Assert GET
            Assert.AreNotEqual(retrunModel, order);

            //Arrange UPDATE
            var oldName = order.CustomerName;

            order.CustomerName = Guid.NewGuid().ToString();

            //Act UPDATE
            await _client.UpdateOrder(order);

            order = await _client.GetOrder(order.Id);

            //Assert UPDATE
            Assert.AreNotEqual(oldName, order.CustomerName);

            //Act DELETE
            await _client.DeleteOrder(order.Id);

            order = await _client.GetOrder(order.Id);

            //Assert DELETE
            Assert.IsNull(order);
        }