Example #1
0
        public void WhenIProcessTheFile()
        {
            ImageMemoryStream.Seek(0, SeekOrigin.Begin);
            const string classifierConfigFile = "svm_config.xml";

            //Arrange
            var handler = new ImageRatingHandler
            {
                Parameters = new WorkItemBase.WorkItemParameters
                {
                    RuntimeData = new Dictionary <string, string>
                    {
                        { "ExhibitId", ExhibitId.ToString(CultureInfo.InvariantCulture) },
                        { "FileId", FileId.ToString(CultureInfo.InvariantCulture) },
                        { "FileCategoryId", CategoryId.ToString(CultureInfo.InvariantCulture) },
                        { "ClassifierConfigFile", Path.GetFullPath(classifierConfigFile) }
                    }
                },
                WorkItemDataStream = ImageMemoryStream
            };

            //Act
            using (new Performance("ImageRating"))
            {
                HandlerOutcome = handler.Execute();
            }
        }
 public void SeekStreamToBeginning()
 {
     if (ImageMemoryStream != null)
     {
         ImageMemoryStream.Seek(0, SeekOrigin.Begin);
     }
 }
Example #3
0
 public MemoryStream GetAndResetImageMemoryStream()
 {
     ImageMemoryStream.Seek(0, SeekOrigin.Begin);
     return(ImageMemoryStream);
 }