Ejemplo n.º 1
0
        public void StringCorrectSSD()
        {
            SelfDescribingData data = ProcessorAPI.Describe("On the road again");
            var dataview            = data.GetViewOfType(CommonDefinitions.SDDString);

            Assert.IsTrue(dataview.Identifier == CommonDefinitions.SDDString);
        }
Ejemplo n.º 2
0
 public SDDListCharacters() : base(CommonDefinitions.SSDCharList)
 {
     chars = new List <char>();
     this.Calculators.Add(FUNC_GetLength, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(chars.Count)); }));
     //this.Calculators.Add(FUNC_GetLength, (SSDCalculate)GetLength);
     this.Add(ID_LIST_LENGTH, "Length", CommonDefinitions.SDDInteger, FUNC_GetLength);
 }
Ejemplo n.º 3
0
 public void CanProcessFileStream()
 {
     using (FileStream fs = File.Open("d:\\temp\\UPTestFile.txt", FileMode.Open))
     {
         SelfDescribingData data = ProcessorAPI.Describe(fs);
         Assert.IsNotNull(data);
     }
 }
Ejemplo n.º 4
0
        public void StringWholeStringProperty_Length()
        {
            SelfDescribingData data         = ProcessorAPI.Describe("On the road again");
            var dataview                    = data.GetViewOfType(CommonDefinitions.SDDString);
            SelfDescribingData stringLength = dataview.GetProperty(0);

            Assert.IsTrue(stringLength.GetViewDefinition(0).Identifier == CommonDefinitions.SDDInteger);
            Assert.IsTrue(stringLength.GetViewDefinition(0).DisplayValue() == "17");
            Assert.IsTrue((int)stringLength.SourceData == 17);
        }
Ejemplo n.º 5
0
        public void CanProcessStreamg()
        {
            string x = "on the road again";

            byte[] bytes = Encoding.UTF8.GetBytes(x);
            using (MemoryStream ms = new MemoryStream())
            {
                ms.Write(bytes, 0, bytes.Length);
                SelfDescribingData data = ProcessorAPI.Describe(ms);
                Assert.IsNotNull(data);
            }
        }
Ejemplo n.º 6
0
 public SDDUrl() : base(UrlIdentifier)
 {
     value = null;
     //this.Calculators.Add(FUNC_GetLength, (SSDCalculateSingle)(() => { return MainProcessor.Describe(value.Length); }));
     //this.Add(ID_WHOLESTRING_LENGTH, "Length", CommonDefinitions.SDDInteger, FUNC_GetLength);
     this.Calculators.Add(FUNC_GetScheme, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.Scheme)); }));
     this.Calculators.Add(FUNC_GetHost, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.DnsSafeHost)); }));
     this.Calculators.Add(FUNC_GetPort, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.Port)); }));
     this.Calculators.Add(FUNC_GetPath, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.LocalPath)); }));
     this.Calculators.Add(FUNC_GetQueryString, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.Query)); }));
     this.Add(ID_WHOLESTRING_LENGTH, "Scheme", CommonDefinitions.SDDString, FUNC_GetScheme);
     this.Add(ID_WHOLESTRING_LENGTH, "Host", CommonDefinitions.SDDString, FUNC_GetHost);
     this.Add(ID_WHOLESTRING_LENGTH, "Port", CommonDefinitions.SDDInteger, FUNC_GetPort);
     this.Add(ID_WHOLESTRING_LENGTH, "Path", CommonDefinitions.SDDString, FUNC_GetPath);
     this.Add(ID_WHOLESTRING_LENGTH, "Query", CommonDefinitions.SDDString, FUNC_GetQueryString);
 }
Ejemplo n.º 7
0
        public void StringAbilities_ViewCount()
        {
            SelfDescribingData data = ProcessorAPI.Describe("On the road again");

            Assert.IsTrue(data.ViewCount == 3);
        }
Ejemplo n.º 8
0
        public void CanProcessString()
        {
            SelfDescribingData data = ProcessorAPI.Describe("On the road again");

            Assert.IsNotNull(data);
        }
 public SDDRangeBoundInteger(Guid Identifier, int initValue) : base(Identifier, initValue)
 {
     this.Add(PROP_LOWERBOUND, "LowerBound", CommonDefinitions.SDDInteger, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(lowerBound)); }));
     this.Add(PROP_UPPERBOUND, "UpperBound", CommonDefinitions.SDDInteger, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(upperBound)); }));
 }
Ejemplo n.º 10
0
 public SDDList() : base(CommonDefinitions.SSDList)
 {
     dataSet = new List <SelfDescribingData>();
     this.Calculators.Add(FUNC_GetCount, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(dataSet.Count)); }));
     this.Add(ID_LIST_LENGTH, "Count", CommonDefinitions.SDDInteger, FUNC_GetCount);
 }
Ejemplo n.º 11
0
 public SDDWord() : base(CommonDefinitions.SDDWord)
 {
     value = "";
     this.Calculators.Add(FUNC_GetLength, (SSDCalculateSingle)(() => { return(ProcessorAPI.Describe(value.Length)); }));
     this.Add(ID_WHOLESTRING_LENGTH, "Length", CommonDefinitions.SDDInteger, FUNC_GetLength);
 }