private void AssertFail(
            Func <object, ValueParseResult> itemParseFn,
            object collectionToParse)
        {
            ValueParseResult parseResult = CollectionParser.Parse(collectionToParse, itemParseFn);

            Assert.That(parseResult.Success, Is.False);
            Assert.That(parseResult.Value, Is.Null);
            Assert.That(parseResult.ErrorDetails, Is.Not.Empty);
        }
        private void AssertSuccess(
            Func <object, ValueParseResult> itemParseFn,
            object collectionToParse,
            IEnumerable expectedCollection)
        {
            ValueParseResult parseResult = CollectionParser.Parse(collectionToParse, itemParseFn);

            Assert.That(parseResult.Success, Is.True);
            Assert.That(parseResult.Value, Is.EquivalentTo(expectedCollection));
        }
 public static MessageBuildResult Build(
     string token,
     IEnumerable <ObjectProperty> superProperties,
     object rawProperties,
     object distinctId,
     MixpanelConfig config)
 {
     return(PeopleMessageBuilderBase.CreateMessage(
                token,
                superProperties,
                rawProperties,
                distinctId,
                config,
                "$union",
                rawValue => CollectionParser.Parse(rawValue, _ => GenericPropertyParser.Parse(_, allowCollections: false))));
 }