public void UpdateProductSeries_creates_new_product_series_and_returns_ok()
        {
            ProductSeries series = new AnonymousProductSeriesBuilder().build();

            string result = WebMethods.ProductSeriesMethods.UpdateProductSeries(series);

            result = XElement.Parse(result).Value;

            Assert.IsTrue(result == "ok",
                          string.Format("ProductSeries with id {0} could not be created/updated. Unexpected return value: {1}", series.Id, result));
        }
        public void DeleteProductSeriesById_with_valid_id_returns_ok()
        {
            ProductSeries series = new AnonymousProductSeriesBuilder().build();

            string result = WebMethods.ProductSeriesMethods.UpdateProductSeries(series);

            result = XElement.Parse(result).Value;
            Assert.IsTrue(result == "ok",
                          string.Format("Product Series {0} could not be created/updated. Unexpected return value: {1}", series.Id, result));

            result = WebMethods.ProductSeriesMethods.DeleteProductSeriesById(series.Id);
            result = XElement.Parse(result).Value;
            Assert.IsTrue(result == "ok",
                          string.Format("Product Series {0} could not be deleted. Unexpected return value: {1}", series.Id, result));
        }
        public void UpdateProductSeries_with_values_saves_all_data_correctly()
        {
            ProductSeries series = new AnonymousProductSeriesBuilder().build();

            //save the product series to the webshop
            string result = WebMethods.ProductSeriesMethods.UpdateProductSeries(series);

            result = XElement.Parse(result).Value;

            Assert.IsTrue(result == "ok",
                          string.Format("Product Series with id {0} could not be created/updated. Unexpected return value was: {1}", series.Id, result));

            //retrieve the series from the webshop
            string        errorMsg;
            ProductSeries seriesFromWS = WebMethods.ProductSeriesMethods.GetProductSeriesById(series.Id, out errorMsg);

            //compare all values
            Assert.AreEqual(series.Id, seriesFromWS.Id, "The field comparison for field \"id\" failed.");
            Assert.AreEqual(series.Name, seriesFromWS.Name, "The field comparison for field \"name\" failed.");
            Assert.AreEqual(series.Test, seriesFromWS.Test, "The field comparison for field \"test\" failed.");
            Assert.AreEqual(series.CreatedDttm, seriesFromWS.CreatedDttm, "The field comparison for field \"created\" failed.");
            Assert.AreEqual(series.UpdatedDttm, seriesFromWS.UpdatedDttm, "The field comparison for field \"updated\" failed.");
            Assert.AreEqual(series.DeletedDttm, seriesFromWS.DeletedDttm, "The field comparison for field \"deleted\" failed.");
        }