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]); }
public void TypeCacheParseClassNamesNullTest() { var typeCache = new TypeCache(); typeCache.ParseClassNames(null); }
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]); }
public void TypeCacheParseClassNamesEmptyManifestTest() { var typeCache = new TypeCache(); typeCache.ParseClassNames(string.Empty); }