ParseClassNames() 공개 메소드

public ParseClassNames ( string manifest ) : string[]>.Tuple
manifest string
리턴 string[]>.Tuple
예제 #1
0
        public void TypeCacheParseStructNameIgnoresInvalidTypesTest()
        {
            var testManifest = @"namespace DataModel

            struct EquilateralTriangle{
            1: optional		int64		Side;
            2: optional     string		Source;

            [OccurenceTime("")]
            3: optional     int64		TimeStampUtc;
            };
            struct InvalidTriangle}
            1: optional		int64		Side;
            2: optional     string		Source;

            [OccurenceTime("")]
            3: optional     int64		TimeStampUtc;
            };
            struct ValidTriangle{
            1: optional		int64		Side;
            2: optional     string		Source;

            [OccurenceTime("")]
            3: optional     int64		TimeStampUtc;
            };";
            var typeCache = new TypeCache();
            var tuple = typeCache.ParseClassNames(testManifest);

            Assert.AreEqual("DataModel", tuple.Item1);
            Assert.AreEqual("EquilateralTriangle", tuple.Item2[0]);
            Assert.AreEqual("ValidTriangle", tuple.Item2[1]);
        }
예제 #2
0
 public void TypeCacheParseClassNamesNullTest()
 {
     var typeCache = new TypeCache();
     typeCache.ParseClassNames(null);
 }
예제 #3
0
        public void TypeCacheParseStructNameHasCurlyBracesHappyPathTest()
        {
            var testManifest = @"namespace DataModel

            struct EquilateralTriangle{
            1: optional		int64		Side;
            2: optional     string		Source;

            [OccurenceTime("")]
            3: optional     int64		TimeStampUtc;
            };
            struct SomeOtherTriangle{
            1: optional		int64		Side;
            2: optional     string		Source;

            [OccurenceTime("")]
            3: optional     int64		TimeStampUtc;
            };";
            var typeCache = new TypeCache();
            var tuple = typeCache.ParseClassNames(testManifest);

            Assert.AreEqual("DataModel", tuple.Item1);
            Assert.AreEqual("EquilateralTriangle", tuple.Item2[0]);
            Assert.AreEqual("SomeOtherTriangle", tuple.Item2[1]);
        }
예제 #4
0
 public void TypeCacheParseClassNamesEmptyManifestTest()
 {
     var typeCache = new TypeCache();
     typeCache.ParseClassNames(string.Empty);
 }