public void SaveCategoryImageNullCategoryNameFaultTest()
 {
     using (var client = new CategoriesServiceClient())
     {
         client.SaveCategoryImage(string.Empty, new MemoryStream());
     }
 }
 public void GetCategoryImageFaultTest()
 {
     using (var client = new CategoriesServiceClient())
     {
         var invalidCategoryName = Guid.NewGuid().ToString();
         var stream = client.GetCategoryImage(invalidCategoryName);
     }
 }
        public void GetCategoryNamesTest()
        {
            using (var client = new CategoriesServiceClient())
            {
                var names = client.GetCategoryNames();

                Assert.IsTrue(names != null && names.Any());
            }
        }
        public void SaveCategoryImageTest()
        {
            using (var client = new CategoriesServiceClient())
            {
                var names = client.GetCategoryNames();
                var categoryName = names.First();

                var readerStream = client.GetCategoryImage(categoryName);

                var memoryStream = this.ReadDataToMemoryStream(readerStream);
                memoryStream.Position = 0;

                client.SaveCategoryImage(categoryName, memoryStream);
            }
        }
        public void GetCategoryImageTest()
        {
            using (var client = new CategoriesServiceClient())
            {
                var names = client.GetCategoryNames();

                var categoryName = names.First();

                var readerStream = client.GetCategoryImage(categoryName);

                var memoryStream = this.ReadDataToMemoryStream(readerStream);

                Assert.IsTrue(memoryStream.Length > 0);
            }
        }
        public void SaveCategoryImageWrongCategoryNameFaultTest()
        {
            using (var client = new CategoriesServiceClient())
            {
                var wrongCategoryName = Guid.NewGuid().ToString();
                var stream = new MemoryStream();

                client.SaveCategoryImage(wrongCategoryName, stream);
            }
        }