public void PropertiesClassGivesSameResultsAsParameterFileTree()
        {
            var rootDir   = Path.GetFullPath(RelativePath);
            var tree      = new FileTree(rootDir);
            var filesRead = 0;
            var propsRead = 0;

            foreach (var file in tree.NodeRegistry)
            {
                var pc = new PropertiesClass();
                Assert.IsTrue(System.IO.File.Exists(file.Key));
                using (var stream = new FileStream(file.Key, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    pc.Load(stream);
                    foreach (var prop in file.Value.Properties)
                    {
                        Assert.AreEqual(prop.Value, pc.GetProperty(prop.Key));
                        propsRead++;
                    }
                }
                filesRead++;
            }
            context.WriteLine("Total Files Parsed: {0}", filesRead);
            context.WriteLine("Total Properties Compared: {0}", propsRead);
        }
        public List <PropertiesClass> ListProperties()
        {
            var listString = new List <PropertiesClass>();

            _swModelDocExtComp = SwModel.Extension;

            var propNames  = default(object);
            var propTypes  = default(object);
            var propValues = default(object);

            _swCustPropMgrComp = _swModelDocExtComp.CustomPropertyManager["00"];

            _swCustPropMgrComp.GetAll(ref propNames, ref propTypes, ref propValues);

            var asCustPropName = (string[])propNames;

            //var asCustPropValues = (string[])propValues;

            for (var i = 0; i < asCustPropName.GetUpperBound(0) - 1; i++)
            {
                var columnValue = new PropertiesClass
                {
                    PropertiesName = asCustPropName[i]
                };

                listString.Add(columnValue);
            }
            return(listString);
        }
        private void PrintPropertiesClass(PropertiesClass pclass)
        {
            context.WriteLine(divider);
            context.WriteLine("PropertiesClass Properties: {0}", pclass.Keys.Count);
            var fmt = "{0}{1}{2}{3}";

            foreach (var key in pclass.Keys)
            {
                context.WriteLine(fmt, "\t", key, " = ", pclass.GetProperty(key.ToString()));
            }
            context.WriteLine(divider);
        }
        public void Fixture_CustomizeApply_ReturnsValueWithApply()
        {
            var fixture = new Fixture();

            PropertiesClass propertiesClass = null;

            fixture.Customize <PropertiesClass>().Apply(x => propertiesClass = x);

            var instance = fixture.Generate <PropertiesClass>();

            Assert.NotNull(instance);
            Assert.NotNull(propertiesClass);
            Assert.Same(propertiesClass, instance);
        }
 public ImagingService(string appSid, string appKey)
     : base(appSid, appKey)
 {
     AppSid = appSid;
     AppKey = appKey;
     Bmp = new BmpClass(AppSid, AppKey);
     Crop = new CropClass(AppSid, AppKey);
     Frame = new FramesClass(AppSid, AppKey);
     Gif = new GifClass(AppSid, AppKey);
     Jpg = new JpgClass(AppSid, AppKey);
     Png = new PngClass(AppSid, AppKey);
     Properties = new PropertiesClass(AppSid, AppKey);
     Psd = new PsdClass(AppSid, AppKey);
     Resize = new ResizeClass(AppSid, AppKey);
     RotateFlip = new RotateFlipClass(AppSid, AppKey);
     SaveAs = new SaveAsClass(AppSid, AppKey);
     Tiff = new TiffClass(AppSid, AppKey);
     UpdateImage = new UpdateImageClass(AppSid, AppKey);
 }
        public void ParseFile_ec_params()
        {
            var fileSpec   = Path.Combine(Root, "ec.params");
            var fileExists = System.IO.File.Exists(fileSpec);

            Assert.IsTrue(fileExists);
            var props   = new PropertiesClass();
            var fstream = new FileStream(fileSpec, FileMode.Open, FileAccess.Read, FileShare.Read);

            props.Load(fstream);
            fstream.Close();
            Assert.AreEqual(props.Count, 6);
            foreach (var k in props.Keys)
            {
                var v = props[k];
                context.WriteLine("{0} = {1}", k, v);
            }
            WriteFileToContext(fileSpec);
        }
        public void ParseSingleParameterFileForDiagnostics()
        {
            var rootDir  = Path.GetFullPath(RelativePath);
            var subDir   = @"gp\koza";
            var fileName = "koza.params";
            var filePath = Path.Combine(rootDir, subDir, fileName);

            if (!Directory.Exists(rootDir))
            {
                context.WriteLine("Invalid path specified: {0}", rootDir);
                return;
            }
            if (!System.IO.File.Exists(filePath))
            {
                context.WriteLine("Invalid file specified {0}", fileName);
                context.WriteLine("FullName: {0}", filePath);
                return;
            }
            context.WriteLine("{0} = {1}", "RelativePath", RelativePath);
            context.WriteLine("{0} = {1}", "AbsolutePath", rootDir);

            var tree = new FileTree(rootDir);
            var pf   = tree.NodeRegistry[Path.Combine(rootDir, filePath)];

            Assert.IsNotNull(pf);
            context.WriteLine("Current File: {0}", pf.FullName);
            PrintParameterFile(pf);

            var pc = new PropertiesClass();

            using (var fs = new FileStream(pf.FullName, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                pc.Load(fs);
                Assert.AreEqual(pc.Keys.Count, pf.Properties.Count);
                PrintPropertiesClass(pc);
            }
        }
 public void BeforeSerialization()
 {
     m_serializedProperties = new PropertiesClass(Properties);
 }
 public void BeforeSerialization()
 {
     m_serializedProperties = new PropertiesClass(Properties);
 }